summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/EasyDialogs.py6
-rw-r--r--Lib/plat-mac/aetools.py2
-rw-r--r--Lib/plat-mac/gensuitemodule.py2
-rw-r--r--Lib/plat-mac/terminalcommand.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/Lib/plat-mac/EasyDialogs.py b/Lib/plat-mac/EasyDialogs.py
index 2f0e3d3..68beafa 100644
--- a/Lib/plat-mac/EasyDialogs.py
+++ b/Lib/plat-mac/EasyDialogs.py
@@ -651,7 +651,7 @@ def AskFileForOpen(
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 @@ def AskFileForSave(
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 @@ def AskFolder(
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:
diff --git a/Lib/plat-mac/aetools.py b/Lib/plat-mac/aetools.py
index dd06e3e..7ba5074 100644
--- a/Lib/plat-mac/aetools.py
+++ b/Lib/plat-mac/aetools.py
@@ -86,7 +86,7 @@ def unpackevent(ae, formodulename=""):
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)
diff --git a/Lib/plat-mac/gensuitemodule.py b/Lib/plat-mac/gensuitemodule.py
index 1864f4f..9d4df6d 100644
--- a/Lib/plat-mac/gensuitemodule.py
+++ b/Lib/plat-mac/gensuitemodule.py
@@ -191,7 +191,7 @@ def processfile(fullname, output=None, basepkgname=None,
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)
diff --git a/Lib/plat-mac/terminalcommand.py b/Lib/plat-mac/terminalcommand.py
index a2f008c..da1c28a 100644
--- a/Lib/plat-mac/terminalcommand.py
+++ b/Lib/plat-mac/terminalcommand.py
@@ -36,7 +36,7 @@ def run(command):
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)