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
58682b7f
Commit
58682b7f
authored
Aug 11, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only catch the errors that can actually occur, as reported in bug #411881.
parent
f3456912
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Lib/types.py
Lib/types.py
+7
-3
Lib/urllib.py
Lib/urllib.py
+2
-2
No files found.
Lib/types.py
View file @
58682b7f
...
...
@@ -31,7 +31,8 @@ FunctionType = type(_f)
LambdaType
=
type
(
lambda
:
None
)
# Same as FunctionType
try
:
CodeType
=
type
(
_f
.
func_code
)
except
:
except
RuntimeError
:
# Execution in restricted environment
pass
def
g
():
...
...
@@ -54,7 +55,8 @@ ModuleType = type(sys)
try
:
FileType
=
type
(
sys
.
__stdin__
)
except
:
except
AttributeError
:
# Not available in restricted mode
pass
XRangeType
=
type
(
xrange
(
0
))
...
...
@@ -65,7 +67,9 @@ except TypeError:
tb
=
sys
.
exc_info
()[
2
]
TracebackType
=
type
(
tb
)
FrameType
=
type
(
tb
.
tb_frame
)
except
:
except
AttributeError
:
# In the restricted environment, exc_info returns (None, None,
# None) Then, tb.tb_frame gives an attribute error
pass
tb
=
None
;
del
tb
...
...
Lib/urllib.py
View file @
58682b7f
...
...
@@ -134,7 +134,7 @@ class URLopener:
for
file
in
self
.
__tempfiles
:
try
:
self
.
__unlink
(
file
)
except
:
except
OSError
:
pass
del
self
.
__tempfiles
[:]
if
self
.
tempcache
:
...
...
@@ -1069,7 +1069,7 @@ def unquote(s):
try
:
myappend
(
mychr
(
myatoi
(
item
[:
2
],
16
))
+
item
[
2
:])
except
:
except
ValueError
:
myappend
(
'%'
+
item
)
else
:
myappend
(
'%'
+
item
)
...
...
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