From: Zac Medico Date: Sun, 22 Nov 2009 01:58:05 +0000 (-0000) Subject: Bug #293998 - Use OSError.errno instead of trying to subscript the exception X-Git-Tag: v2.2_rc52~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c288717b899043fbea62c3f743e5d56d6751d1e6;p=portage.git 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. svn path=/main/trunk/; revision=14873 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 4b6f841d4..2641472e5 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)