| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7357c23 commit d11b68a
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -131,7 +131,7 @@ def setlockdir(self): | |||
| 131 | 131 | return | |
| 132 | 132 | except os.error as msg: | |
| 133 | 133 | self.lockdir = None | |
| 134 | - if msg[0] == EEXIST: | ||
| 134 | + if msg.args[0] == EEXIST: | ||
| 135 | 135 | try: | |
| 136 | 136 | st = os.stat(self.cvslck) | |
| 137 | 137 | except os.error: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,8 +89,8 @@ def _toaiff(filename, temps): | |||
| 89 | 89 | ftype = ftype[0] # All we're interested in | |
| 90 | 90 | except IOError as msg: | |
| 91 | 91 | if type(msg) == type(()) and len(msg) == 2 and \ | |
| 92 | - type(msg[0]) == type(0) and type(msg[1]) == type(''): | ||
| 93 | - msg = msg[1] | ||
| 92 | + type(msg.args[0]) == type(0) and type(msg.args[1]) == type(''): | ||
| 93 | + msg = msg.args[1] | ||
| 94 | 94 | if type(msg) != type(''): | |
| 95 | 95 | msg = repr(msg) | |
| 96 | 96 | raise error(filename + ': ' + msg) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -139,7 +139,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, | |||
| 139 | 139 | macostools.copy(src, dst, 0, preserve_times) | |
| 140 | 140 | except os.error as exc: | |
| 141 | 141 | raise DistutilsFileError( | |
| 142 | - "could not copy '%s' to '%s': %s" % (src, dst, exc[-1])) | ||
| 142 | + "could not copy '%s' to '%s': %s" % (src, dst, exc.args[-1])) | ||
| 143 | 143 | ||
| 144 | 144 | # If linking (hard or symbolic), use the appropriate system call | |
| 145 | 145 | # (Unix only, of course, but that's the caller's responsibility) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,7 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0): | |||
| 67 | 67 | except OSError as exc: | |
| 68 | 68 | # this seems to happen when the command isn't found | |
| 69 | 69 | raise DistutilsExecError( | |
| 70 | - "command '%s' failed: %s" % (cmd[0], exc[-1])) | ||
| 70 | + "command '%s' failed: %s" % (cmd[0], exc.args[-1])) | ||
| 71 | 71 | if rc != 0: | |
| 72 | 72 | # and this reflects the command running but failing | |
| 73 | 73 | raise DistutilsExecError( | |
@@ -88,7 +88,7 @@ def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0): | |||
| 88 | 88 | except OSError as exc: | |
| 89 | 89 | # this seems to happen when the command isn't found | |
| 90 | 90 | raise DistutilsExecError( | |
| 91 | - "command '%s' failed: %s" % (cmd[0], exc[-1])) | ||
| 91 | + "command '%s' failed: %s" % (cmd[0], exc.args[-1])) | ||
| 92 | 92 | if rc != 0: | |
| 93 | 93 | # and this reflects the command running but failing | |
| 94 | 94 | print("command '%s' failed with exit status %d" % (cmd[0], rc)) | |
@@ -124,7 +124,7 @@ def _spawn_posix(cmd, search_path=1, verbose=0, dry_run=0): | |||
| 124 | 124 | if exc.errno == errno.EINTR: | |
| 125 | 125 | continue | |
| 126 | 126 | raise DistutilsExecError( | |
| 127 | - "command '%s' failed: %s" % (cmd[0], exc[-1])) | ||
| 127 | + "command '%s' failed: %s" % (cmd[0], exc.args[-1])) | ||
| 128 | 128 | if os.WIFSIGNALED(status): | |
| 129 | 129 | raise DistutilsExecError( | |
| 130 | 130 | "command '%s' terminated by signal %d" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,12 +149,12 @@ def phase2(self): # Distinguish files, directories, funnies | |||
| 149 | 149 | try: | |
| 150 | 150 | a_stat = os.stat(a_path) | |
| 151 | 151 | except os.error as why: | |
| 152 | - # print 'Can\'t stat', a_path, ':', why[1] | ||
| 152 | + # print('Can\'t stat', a_path, ':', why.args[1]) | ||
| 153 | 153 | ok = 0 | |
| 154 | 154 | try: | |
| 155 | 155 | b_stat = os.stat(b_path) | |
| 156 | 156 | except os.error as why: | |
| 157 | - # print 'Can\'t stat', b_path, ':', why[1] | ||
| 157 | + # print('Can\'t stat', b_path, ':', why.args[1]) | ||
| 158 | 158 | ok = 0 | |
| 159 | 159 | ||
| 160 | 160 | if ok: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -651,7 +651,7 @@ def AskFileForOpen( | |||
| 651 | 651 | rr = Nav.NavChooseFile(args) | |
| 652 | 652 | good = 1 | |
| 653 | 653 | except Nav.error as arg: | |
| 654 | - if arg[0] != -128: # userCancelledErr | ||
| 654 | + if arg.args[0] != -128: # userCancelledErr | ||
| 655 | 655 | raise Nav.error(arg) | |
| 656 | 656 | return None | |
| 657 | 657 | if not rr.validRecord or not rr.selection: | |
@@ -704,7 +704,7 @@ def AskFileForSave( | |||
| 704 | 704 | rr = Nav.NavPutFile(args) | |
| 705 | 705 | good = 1 | |
| 706 | 706 | except Nav.error as arg: | |
| 707 | - if arg[0] != -128: # userCancelledErr | ||
| 707 | + if arg.args[0] != -128: # userCancelledErr | ||
| 708 | 708 | raise Nav.error(arg) | |
| 709 | 709 | return None | |
| 710 | 710 | if not rr.validRecord or not rr.selection: | |
@@ -764,7 +764,7 @@ def AskFolder( | |||
| 764 | 764 | rr = Nav.NavChooseFolder(args) | |
| 765 | 765 | good = 1 | |
| 766 | 766 | except Nav.error as arg: | |
| 767 | - if arg[0] != -128: # userCancelledErr | ||
| 767 | + if arg.args[0] != -128: # userCancelledErr | ||
| 768 | 768 | raise Nav.error(arg) | |
| 769 | 769 | return None | |
| 770 | 770 | if not rr.validRecord or not rr.selection: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,7 +86,7 @@ def unpackevent(ae, formodulename=""): | |||
| 86 | 86 | try: | |
| 87 | 87 | desc = ae.AEGetAttributeDesc(key, '****') | |
| 88 | 88 | except (AE.Error, MacOS.Error) as msg: | |
| 89 | - if msg[0] != -1701 and msg[0] != -1704: | ||
| 89 | + if msg.args[0] not in (-1701, -1704): | ||
| 90 | 90 | raise | |
| 91 | 91 | continue | |
| 92 | 92 | attributes[key] = unpack(desc, formodulename) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -191,7 +191,7 @@ def processfile(fullname, output=None, basepkgname=None, | |||
| 191 | 191 | try: | |
| 192 | 192 | aedescobj, launched = OSATerminology.GetAppTerminology(fullname) | |
| 193 | 193 | except MacOS.Error as arg: | |
| 194 | - if arg[0] in (-1701, -192): # errAEDescNotFound, resNotFound | ||
| 194 | + if arg.args[0] in (-1701, -192): # errAEDescNotFound, resNotFound | ||
| 195 | 195 | if verbose: | |
| 196 | 196 | print("GetAppTerminology failed with errAEDescNotFound/resNotFound, trying manually", file=verbose) | |
| 197 | 197 | aedata, sig = getappterminology(fullname, verbose=verbose) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ def run(command): | |||
| 36 | 36 | try: | |
| 37 | 37 | theEvent.AESend(SEND_MODE, kAENormalPriority, kAEDefaultTimeout) | |
| 38 | 38 | except AE.Error as why: | |
| 39 | - if why[0] != -600: # Terminal.app not yet running | ||
| 39 | + if why.args[0] != -600: # Terminal.app not yet running | ||
| 40 | 40 | raise | |
| 41 | 41 | os.system(START_TERMINAL) | |
| 42 | 42 | time.sleep(1) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments