From: Zac Medico Date: Wed, 25 Nov 2009 22:31:51 +0000 (-0000) Subject: Bug #293998 - Use OSError.errno instead of trying to subscript the exception X-Git-Tag: v2.1.7.7~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93b66c3ef76d69f6b2696822d38ac2b46faa8c01;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. (trunk r14873) svn path=/main/branches/2.1.7/; revision=14887 --- 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)