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
2b149860
Commit
2b149860
authored
Jun 29, 2013
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18316: Update idlelib 2.7 except clauses to ease backports.
parent
8eab008b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+1
-1
Lib/idlelib/GrepDialog.py
Lib/idlelib/GrepDialog.py
+1
-1
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+4
-4
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+4
-4
Lib/idlelib/ScriptBinding.py
Lib/idlelib/ScriptBinding.py
+3
-3
Lib/idlelib/SearchEngine.py
Lib/idlelib/SearchEngine.py
+1
-1
Lib/idlelib/run.py
Lib/idlelib/run.py
+1
-1
No files found.
Lib/idlelib/EditorWindow.py
View file @
2b149860
...
...
@@ -689,7 +689,7 @@ class EditorWindow(object):
# XXX Ought to insert current file's directory in front of path
try
:
(
f
,
file
,
(
suffix
,
mode
,
type
))
=
_find_module
(
name
)
except
(
NameError
,
ImportError
)
,
msg
:
except
(
NameError
,
ImportError
)
as
msg
:
tkMessageBox
.
showerror
(
"Import error"
,
str
(
msg
),
parent
=
self
.
text
)
return
if
type
!=
imp
.
PY_SOURCE
:
...
...
Lib/idlelib/GrepDialog.py
View file @
2b149860
...
...
@@ -98,7 +98,7 @@ class GrepDialog(SearchDialogBase):
def
findfiles
(
self
,
dir
,
base
,
rec
):
try
:
names
=
os
.
listdir
(
dir
or
os
.
curdir
)
except
os
.
error
,
msg
:
except
os
.
error
as
msg
:
print
msg
return
[]
list
=
[]
...
...
Lib/idlelib/IOBinding.py
View file @
2b149860
...
...
@@ -251,7 +251,7 @@ class IOBinding:
f
=
open
(
filename
,
'rb'
)
chars
=
f
.
read
()
f
.
close
()
except
IOError
,
msg
:
except
IOError
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
return
False
...
...
@@ -294,7 +294,7 @@ class IOBinding:
# Next look for coding specification
try
:
enc
=
coding_spec
(
chars
)
except
LookupError
,
name
:
except
LookupError
as
name
:
tkMessageBox
.
showerror
(
title
=
"Error loading the file"
,
message
=
"The encoding '%s' is not known to this Python "
\
...
...
@@ -388,7 +388,7 @@ class IOBinding:
f
.
flush
()
f
.
close
()
return
True
except
IOError
,
msg
:
except
IOError
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
return
False
...
...
@@ -408,7 +408,7 @@ class IOBinding:
try
:
enc
=
coding_spec
(
chars
)
failed
=
None
except
LookupError
,
msg
:
except
LookupError
as
msg
:
failed
=
msg
enc
=
None
if
enc
:
...
...
Lib/idlelib/PyShell.py
View file @
2b149860
...
...
@@ -430,7 +430,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
try
:
self
.
rpcclt
=
MyRPCClient
(
addr
)
break
except
socket
.
error
,
err
:
except
socket
.
error
as
err
:
pass
else
:
self
.
display_port_binding_error
()
...
...
@@ -451,7 +451,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
self
.
rpcclt
.
listening_sock
.
settimeout
(
10
)
try
:
self
.
rpcclt
.
accept
()
except
socket
.
timeout
,
err
:
except
socket
.
timeout
as
err
:
self
.
display_no_subprocess_error
()
return
None
self
.
rpcclt
.
register
(
"console"
,
self
.
tkconsole
)
...
...
@@ -486,7 +486,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
self
.
spawn_subprocess
()
try
:
self
.
rpcclt
.
accept
()
except
socket
.
timeout
,
err
:
except
socket
.
timeout
as
err
:
self
.
display_no_subprocess_error
()
return
None
self
.
transfer_path
(
with_cwd
=
with_cwd
)
...
...
@@ -1458,7 +1458,7 @@ def main():
startup
=
False
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"c:deihnr:st:"
)
except
getopt
.
error
,
msg
:
except
getopt
.
error
as
msg
:
sys
.
stderr
.
write
(
"Error: %s
\
n
"
%
str
(
msg
))
sys
.
stderr
.
write
(
usage_msg
)
sys
.
exit
(
2
)
...
...
Lib/idlelib/ScriptBinding.py
View file @
2b149860
...
...
@@ -70,13 +70,13 @@ class ScriptBinding:
f
=
open
(
filename
,
'r'
)
try
:
tabnanny
.
process_tokens
(
tokenize
.
generate_tokens
(
f
.
readline
))
except
tokenize
.
TokenError
,
msg
:
except
tokenize
.
TokenError
as
msg
:
msgtxt
,
(
lineno
,
start
)
=
msg
self
.
editwin
.
gotoline
(
lineno
)
self
.
errorbox
(
"Tabnanny Tokenizing Error"
,
"Token Error: %s"
%
msgtxt
)
return
False
except
tabnanny
.
NannyNag
,
nag
:
except
tabnanny
.
NannyNag
as
nag
:
# The error messages from tabnanny are too confusing...
self
.
editwin
.
gotoline
(
nag
.
get_lineno
())
self
.
errorbox
(
"Tab/space error"
,
indent_message
)
...
...
@@ -101,7 +101,7 @@ class ScriptBinding:
try
:
# If successful, return the compiled code
return
compile
(
source
,
filename
,
"exec"
)
except
(
SyntaxError
,
OverflowError
,
ValueError
)
,
err
:
except
(
SyntaxError
,
OverflowError
,
ValueError
)
as
err
:
try
:
msg
,
(
errorfilename
,
lineno
,
offset
,
line
)
=
err
if
not
errorfilename
:
...
...
Lib/idlelib/SearchEngine.py
View file @
2b149860
...
...
@@ -66,7 +66,7 @@ class SearchEngine:
flags
=
flags
|
re
.
IGNORECASE
try
:
prog
=
re
.
compile
(
pat
,
flags
)
except
re
.
error
,
what
:
except
re
.
error
as
what
:
try
:
msg
,
col
=
what
except
:
...
...
Lib/idlelib/run.py
View file @
2b149860
...
...
@@ -140,7 +140,7 @@ def manage_socket(address):
try
:
server
=
MyRPCServer
(
address
,
MyHandler
)
break
except
socket
.
error
,
err
:
except
socket
.
error
as
err
:
print
>>
sys
.
__stderr__
,
"IDLE Subprocess: socket error: "
\
+
err
.
args
[
1
]
+
", retrying...."
else
:
...
...
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