Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d11b68ab
Commit
d11b68ab
authored
Jan 06, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more exception slicing.
parent
7357c23e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
Demo/pdist/cvslock.py
Demo/pdist/cvslock.py
+1
-1
Demo/scripts/toaiff.py
Demo/scripts/toaiff.py
+2
-2
Lib/distutils/file_util.py
Lib/distutils/file_util.py
+1
-1
Lib/distutils/spawn.py
Lib/distutils/spawn.py
+3
-3
Lib/filecmp.py
Lib/filecmp.py
+2
-2
Lib/plat-mac/EasyDialogs.py
Lib/plat-mac/EasyDialogs.py
+3
-3
Lib/plat-mac/aetools.py
Lib/plat-mac/aetools.py
+1
-1
Lib/plat-mac/gensuitemodule.py
Lib/plat-mac/gensuitemodule.py
+1
-1
Lib/plat-mac/terminalcommand.py
Lib/plat-mac/terminalcommand.py
+1
-1
No files found.
Demo/pdist/cvslock.py
View file @
d11b68ab
...
@@ -131,7 +131,7 @@ class Lock:
...
@@ -131,7 +131,7 @@ class Lock:
return
return
except
os
.
error
as
msg
:
except
os
.
error
as
msg
:
self
.
lockdir
=
None
self
.
lockdir
=
None
if
msg
[
0
]
==
EEXIST
:
if
msg
.
args
[
0
]
==
EEXIST
:
try
:
try
:
st
=
os
.
stat
(
self
.
cvslck
)
st
=
os
.
stat
(
self
.
cvslck
)
except
os
.
error
:
except
os
.
error
:
...
...
Demo/scripts/toaiff.py
View file @
d11b68ab
...
@@ -89,8 +89,8 @@ def _toaiff(filename, temps):
...
@@ -89,8 +89,8 @@ def _toaiff(filename, temps):
ftype
=
ftype
[
0
]
# All we're interested in
ftype
=
ftype
[
0
]
# All we're interested in
except
IOError
as
msg
:
except
IOError
as
msg
:
if
type
(
msg
)
==
type
(())
and
len
(
msg
)
==
2
and
\
if
type
(
msg
)
==
type
(())
and
len
(
msg
)
==
2
and
\
type
(
msg
[
0
])
==
type
(
0
)
and
type
(
msg
[
1
])
==
type
(
''
):
type
(
msg
.
args
[
0
])
==
type
(
0
)
and
type
(
msg
.
args
[
1
])
==
type
(
''
):
msg
=
msg
[
1
]
msg
=
msg
.
args
[
1
]
if
type
(
msg
)
!=
type
(
''
):
if
type
(
msg
)
!=
type
(
''
):
msg
=
repr
(
msg
)
msg
=
repr
(
msg
)
raise
error
(
filename
+
': '
+
msg
)
raise
error
(
filename
+
': '
+
msg
)
...
...
Lib/distutils/file_util.py
View file @
d11b68ab
...
@@ -139,7 +139,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
...
@@ -139,7 +139,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
macostools
.
copy
(
src
,
dst
,
0
,
preserve_times
)
macostools
.
copy
(
src
,
dst
,
0
,
preserve_times
)
except
os
.
error
as
exc
:
except
os
.
error
as
exc
:
raise
DistutilsFileError
(
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
# If linking (hard or symbolic), use the appropriate system call
# (Unix only, of course, but that's the caller's responsibility)
# (Unix only, of course, but that's the caller's responsibility)
...
...
Lib/distutils/spawn.py
View file @
d11b68ab
...
@@ -67,7 +67,7 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
...
@@ -67,7 +67,7 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
except
OSError
as
exc
:
except
OSError
as
exc
:
# this seems to happen when the command isn't found
# this seems to happen when the command isn't found
raise
DistutilsExecError
(
raise
DistutilsExecError
(
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
[
-
1
]))
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
.
args
[
-
1
]))
if
rc
!=
0
:
if
rc
!=
0
:
# and this reflects the command running but failing
# and this reflects the command running but failing
raise
DistutilsExecError
(
raise
DistutilsExecError
(
...
@@ -88,7 +88,7 @@ def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
...
@@ -88,7 +88,7 @@ def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
except
OSError
as
exc
:
except
OSError
as
exc
:
# this seems to happen when the command isn't found
# this seems to happen when the command isn't found
raise
DistutilsExecError
(
raise
DistutilsExecError
(
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
[
-
1
]))
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
.
args
[
-
1
]))
if
rc
!=
0
:
if
rc
!=
0
:
# and this reflects the command running but failing
# and this reflects the command running but failing
print
(
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
))
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,7 +124,7 @@ def _spawn_posix(cmd, search_path=1, verbose=0, dry_run=0):
if
exc
.
errno
==
errno
.
EINTR
:
if
exc
.
errno
==
errno
.
EINTR
:
continue
continue
raise
DistutilsExecError
(
raise
DistutilsExecError
(
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
[
-
1
]))
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
.
args
[
-
1
]))
if
os
.
WIFSIGNALED
(
status
):
if
os
.
WIFSIGNALED
(
status
):
raise
DistutilsExecError
(
raise
DistutilsExecError
(
"command '%s' terminated by signal %d"
"command '%s' terminated by signal %d"
...
...
Lib/filecmp.py
View file @
d11b68ab
...
@@ -149,12 +149,12 @@ class dircmp:
...
@@ -149,12 +149,12 @@ class dircmp:
try
:
try
:
a_stat
=
os
.
stat
(
a_path
)
a_stat
=
os
.
stat
(
a_path
)
except
os
.
error
as
why
:
except
os
.
error
as
why
:
# print
'Can\'t stat', a_path, ':', why[1]
# print
('Can\'t stat', a_path, ':', why.args[1])
ok
=
0
ok
=
0
try
:
try
:
b_stat
=
os
.
stat
(
b_path
)
b_stat
=
os
.
stat
(
b_path
)
except
os
.
error
as
why
:
except
os
.
error
as
why
:
# print
'Can\'t stat', b_path, ':', why[1]
# print
('Can\'t stat', b_path, ':', why.args[1])
ok
=
0
ok
=
0
if
ok
:
if
ok
:
...
...
Lib/plat-mac/EasyDialogs.py
View file @
d11b68ab
...
@@ -651,7 +651,7 @@ def AskFileForOpen(
...
@@ -651,7 +651,7 @@ def AskFileForOpen(
rr
=
Nav
.
NavChooseFile
(
args
)
rr
=
Nav
.
NavChooseFile
(
args
)
good
=
1
good
=
1
except
Nav
.
error
as
arg
:
except
Nav
.
error
as
arg
:
if
arg
[
0
]
!=
-
128
:
# userCancelledErr
if
arg
.
args
[
0
]
!=
-
128
:
# userCancelledErr
raise
Nav
.
error
(
arg
)
raise
Nav
.
error
(
arg
)
return
None
return
None
if
not
rr
.
validRecord
or
not
rr
.
selection
:
if
not
rr
.
validRecord
or
not
rr
.
selection
:
...
@@ -704,7 +704,7 @@ def AskFileForSave(
...
@@ -704,7 +704,7 @@ def AskFileForSave(
rr
=
Nav
.
NavPutFile
(
args
)
rr
=
Nav
.
NavPutFile
(
args
)
good
=
1
good
=
1
except
Nav
.
error
as
arg
:
except
Nav
.
error
as
arg
:
if
arg
[
0
]
!=
-
128
:
# userCancelledErr
if
arg
.
args
[
0
]
!=
-
128
:
# userCancelledErr
raise
Nav
.
error
(
arg
)
raise
Nav
.
error
(
arg
)
return
None
return
None
if
not
rr
.
validRecord
or
not
rr
.
selection
:
if
not
rr
.
validRecord
or
not
rr
.
selection
:
...
@@ -764,7 +764,7 @@ def AskFolder(
...
@@ -764,7 +764,7 @@ def AskFolder(
rr
=
Nav
.
NavChooseFolder
(
args
)
rr
=
Nav
.
NavChooseFolder
(
args
)
good
=
1
good
=
1
except
Nav
.
error
as
arg
:
except
Nav
.
error
as
arg
:
if
arg
[
0
]
!=
-
128
:
# userCancelledErr
if
arg
.
args
[
0
]
!=
-
128
:
# userCancelledErr
raise
Nav
.
error
(
arg
)
raise
Nav
.
error
(
arg
)
return
None
return
None
if
not
rr
.
validRecord
or
not
rr
.
selection
:
if
not
rr
.
validRecord
or
not
rr
.
selection
:
...
...
Lib/plat-mac/aetools.py
View file @
d11b68ab
...
@@ -86,7 +86,7 @@ def unpackevent(ae, formodulename=""):
...
@@ -86,7 +86,7 @@ def unpackevent(ae, formodulename=""):
try
:
try
:
desc
=
ae
.
AEGetAttributeDesc
(
key
,
'****'
)
desc
=
ae
.
AEGetAttributeDesc
(
key
,
'****'
)
except
(
AE
.
Error
,
MacOS
.
Error
)
as
msg
:
except
(
AE
.
Error
,
MacOS
.
Error
)
as
msg
:
if
msg
[
0
]
!=
-
1701
and
msg
[
0
]
!=
-
1704
:
if
msg
.
args
[
0
]
not
in
(
-
1701
,
-
1704
)
:
raise
raise
continue
continue
attributes
[
key
]
=
unpack
(
desc
,
formodulename
)
attributes
[
key
]
=
unpack
(
desc
,
formodulename
)
...
...
Lib/plat-mac/gensuitemodule.py
View file @
d11b68ab
...
@@ -191,7 +191,7 @@ def processfile(fullname, output=None, basepkgname=None,
...
@@ -191,7 +191,7 @@ def processfile(fullname, output=None, basepkgname=None,
try
:
try
:
aedescobj
,
launched
=
OSATerminology
.
GetAppTerminology
(
fullname
)
aedescobj
,
launched
=
OSATerminology
.
GetAppTerminology
(
fullname
)
except
MacOS
.
Error
as
arg
:
except
MacOS
.
Error
as
arg
:
if
arg
[
0
]
in
(
-
1701
,
-
192
):
# errAEDescNotFound, resNotFound
if
arg
.
args
[
0
]
in
(
-
1701
,
-
192
):
# errAEDescNotFound, resNotFound
if
verbose
:
if
verbose
:
print
(
"GetAppTerminology failed with errAEDescNotFound/resNotFound, trying manually"
,
file
=
verbose
)
print
(
"GetAppTerminology failed with errAEDescNotFound/resNotFound, trying manually"
,
file
=
verbose
)
aedata
,
sig
=
getappterminology
(
fullname
,
verbose
=
verbose
)
aedata
,
sig
=
getappterminology
(
fullname
,
verbose
=
verbose
)
...
...
Lib/plat-mac/terminalcommand.py
View file @
d11b68ab
...
@@ -36,7 +36,7 @@ def run(command):
...
@@ -36,7 +36,7 @@ def run(command):
try
:
try
:
theEvent
.
AESend
(
SEND_MODE
,
kAENormalPriority
,
kAEDefaultTimeout
)
theEvent
.
AESend
(
SEND_MODE
,
kAENormalPriority
,
kAEDefaultTimeout
)
except
AE
.
Error
as
why
:
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
raise
os
.
system
(
START_TERMINAL
)
os
.
system
(
START_TERMINAL
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment