Author: georg.brandl
Date: Sun Jan 6 22:13:42 2008
New Revision: 59793
Modified:
python/branches/py3k/Demo/pdist/cvslock.py
python/branches/py3k/Demo/scripts/toaiff.py
python/branches/py3k/Lib/distutils/file_util.py
python/branches/py3k/Lib/distutils/spawn.py
python/branches/py3k/Lib/filecmp.py
python/branches/py3k/Lib/plat-mac/EasyDialogs.py
python/branches/py3k/Lib/plat-mac/aetools.py
python/branches/py3k/Lib/plat-mac/gensuitemodule.py
python/branches/py3k/Lib/plat-mac/terminalcommand.py
Log:
Fix more exception slicing.
Modified: python/branches/py3k/Demo/pdist/cvslock.py
==============================================================================
--- python/branches/py3k/Demo/pdist/cvslock.py (original)
+++ python/branches/py3k/Demo/pdist/cvslock.py Sun Jan 6 22:13:42 2008
@@ -131,7 +131,7 @@
return
except os.error as msg:
self.lockdir = None
- if msg[0] == EEXIST:
+ if msg.args[0] == EEXIST:
try:
st = os.stat(self.cvslck)
except os.error:
Modified: python/branches/py3k/Demo/scripts/toaiff.py
==============================================================================
--- python/branches/py3k/Demo/scripts/toaiff.py (original)
+++ python/branches/py3k/Demo/scripts/toaiff.py Sun Jan 6 22:13:42 2008
@@ -89,8 +89,8 @@
ftype = ftype[0] # All we're interested in
except IOError as msg:
if type(msg) == type(()) and len(msg) == 2 and \
- type(msg[0]) == type(0) and type(msg[1]) == type(''):
- msg = msg[1]
+ type(msg.args[0]) == type(0) and type(msg.args[1]) == type(''):
+ msg = msg.args[1]
if type(msg) != type(''):
msg = repr(msg)
raise error(filename + ': ' + msg)
Modified: python/branches/py3k/Lib/distutils/file_util.py
==============================================================================
--- python/branches/py3k/Lib/distutils/file_util.py (original)
+++ python/branches/py3k/Lib/distutils/file_util.py Sun Jan 6 22:13:42 2008
@@ -139,7 +139,7 @@
macostools.copy(src, dst, 0, preserve_times)
except os.error as exc:
raise DistutilsFileError(
- "could not copy '%s' to '%s': %s" % (src, dst, exc[-1]))
+ "could not copy '%s' to '%s': %s" % (src, dst, exc.args[-1]))
# If linking (hard or symbolic), use the appropriate system call
# (Unix only, of course, but that's the caller's responsibility)
Modified: python/branches/py3k/Lib/distutils/spawn.py
==============================================================================
--- python/branches/py3k/Lib/distutils/spawn.py (original)
+++ python/branches/py3k/Lib/distutils/spawn.py Sun Jan 6 22:13:42 2008
@@ -67,7 +67,7 @@
except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if rc != 0:
# and this reflects the command running but failing
raise DistutilsExecError(
@@ -88,7 +88,7 @@
except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if rc != 0:
# and this reflects the command running but failing
print("command '%s' failed with exit status %d" % (cmd[0], rc))
@@ -124,7 +124,7 @@
if exc.errno == errno.EINTR:
continue
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if os.WIFSIGNALED(status):
raise DistutilsExecError(
"command '%s' terminated by signal %d"
Modified: python/branches/py3k/Lib/filecmp.py
==============================================================================
--- python/branches/py3k/Lib/filecmp.py (original)
+++ python/branches/py3k/Lib/filecmp.py Sun Jan 6 22:13:42 2008
@@ -149,12 +149,12 @@
try:
a_stat = os.stat(a_path)
except os.error as why:
- # print 'Can\'t stat', a_path, ':', why[1]
+ # print('Can\'t stat', a_path, ':', why.args[1])
ok = 0
try:
b_stat = os.stat(b_path)
except os.error as why:
- # print 'Can\'t stat', b_path, ':', why[1]
+ # print('Can\'t stat', b_path, ':', why.args[1])
ok = 0
if ok:
Modified: python/branches/py3k/Lib/plat-mac/EasyDialogs.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/EasyDialogs.py (original)
+++ python/branches/py3k/Lib/plat-mac/EasyDialogs.py Sun Jan 6 22:13:42 2008
@@ -651,7 +651,7 @@
rr = Nav.NavChooseFile(args)
good = 1
except Nav.error as arg:
- if arg[0] != -128: # userCancelledErr
+ if arg.args[0] != -128: # userCancelledErr
raise Nav.error(arg)
return None
if not rr.validRecord or not rr.selection:
@@ -704,7 +704,7 @@
rr = Nav.NavPutFile(args)
good = 1
except Nav.error as arg:
- if arg[0] != -128: # userCancelledErr
+ if arg.args[0] != -128: # userCancelledErr
raise Nav.error(arg)
return None
if not rr.validRecord or not rr.selection:
@@ -764,7 +764,7 @@
rr = Nav.NavChooseFolder(args)
good = 1
except Nav.error as arg:
- if arg[0] != -128: # userCancelledErr
+ if arg.args[0] != -128: # userCancelledErr
raise Nav.error(arg)
return None
if not rr.validRecord or not rr.selection:
Modified: python/branches/py3k/Lib/plat-mac/aetools.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/aetools.py (original)
+++ python/branches/py3k/Lib/plat-mac/aetools.py Sun Jan 6 22:13:42 2008
@@ -86,7 +86,7 @@
try:
desc = ae.AEGetAttributeDesc(key, '****')
except (AE.Error, MacOS.Error) as msg:
- if msg[0] != -1701 and msg[0] != -1704:
+ if msg.args[0] not in (-1701, -1704):
raise
continue
attributes[key] = unpack(desc, formodulename)
Modified: python/branches/py3k/Lib/plat-mac/gensuitemodule.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/gensuitemodule.py (original)
+++ python/branches/py3k/Lib/plat-mac/gensuitemodule.py Sun Jan 6 22:13:42 2008
@@ -191,7 +191,7 @@
try:
aedescobj, launched = OSATerminology.GetAppTerminology(fullname)
except MacOS.Error as arg:
- if arg[0] in (-1701, -192): # errAEDescNotFound, resNotFound
+ if arg.args[0] in (-1701, -192): # errAEDescNotFound, resNotFound
if verbose:
print("GetAppTerminology failed with
errAEDescNotFound/resNotFound, trying manually", file=verbose)
aedata, sig = getappterminology(fullname, verbose=verbose)
Modified: python/branches/py3k/Lib/plat-mac/terminalcommand.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/terminalcommand.py (original)
+++ python/branches/py3k/Lib/plat-mac/terminalcommand.py Sun Jan 6
22:13:42 2008
@@ -36,7 +36,7 @@
try:
theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout)
except AE.Error as why:
- if why[0] != -600: # Terminal.app not yet running
+ if why.args[0] != -600: # Terminal.app not yet running
raise
os.system(START_TERMINAL)
time.sleep(1)
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins