diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-25 22:31:51 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-25 22:31:51 +0000 |
commit | 93b66c3ef76d69f6b2696822d38ac2b46faa8c01 (patch) | |
tree | 258c6d505dae003d4764bbec9868b087e5f88bce | |
parent | 0260e8005f5a6883c07d6324c45578ebcb0177fc (diff) | |
download | portage-93b66c3ef76d69f6b2696822d38ac2b46faa8c01.tar.gz portage-93b66c3ef76d69f6b2696822d38ac2b46faa8c01.tar.bz2 portage-93b66c3ef76d69f6b2696822d38ac2b46faa8c01.zip |
Bug #293998 - Use OSError.errno instead of trying to subscript the exception
when handling errno.EXDEV in movefile(), since exceptions do not support
subscripting in python3. (trunk r14873)
svn path=/main/branches/2.1.7/; revision=14887
-rw-r--r-- | pym/portage/__init__.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 514e1f46d..25ef6fb3f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7512,10 +7512,8 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, else: ret=os.rename(src,dest) renamefailed=0 - except SystemExit as e: - raise - except Exception as e: - if e[0]!=errno.EXDEV: + except OSError as e: + if e.errno != errno.EXDEV: # Some random error. print(_("!!! Failed to move %(src)s to %(dest)s") % {"src": src, "dest": dest}) print("!!!",e) |