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
3c8484e8
Commit
3c8484e8
authored
Nov 20, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When re-raising an exception raised by a module used internally as
IOError, keep the traceback.
parent
3ffc5036
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Lib/urllib.py
Lib/urllib.py
+5
-3
No files found.
Lib/urllib.py
View file @
3c8484e8
...
...
@@ -18,6 +18,7 @@ import string
import
socket
import
regex
import
os
import
sys
__version__
=
'1.5'
...
...
@@ -130,7 +131,7 @@ class URLopener:
try
:
return
getattr
(
self
,
name
)(
url
)
except
socket
.
error
,
msg
:
raise
IOError
,
(
'socket error'
,
msg
)
raise
IOError
,
(
'socket error'
,
msg
)
,
sys
.
exc_traceback
# Overridable interface to open unknown URL type
def
open_unknown
(
self
,
fullurl
):
...
...
@@ -296,7 +297,7 @@ class URLopener:
return
addinfourl
(
self
.
ftpcache
[
key
].
retrfile
(
file
,
type
),
noheaders
(),
self
.
openedurl
)
except
ftperrors
(),
msg
:
raise
IOError
,
(
'ftp error'
,
msg
)
raise
IOError
,
(
'ftp error'
,
msg
)
,
sys
.
exc_traceback
# Derived class with handlers for errors we can handle (perhaps)
...
...
@@ -465,7 +466,8 @@ class ftpwrapper:
conn
=
self
.
ftp
.
transfercmd
(
cmd
)
except
ftplib
.
error_perm
,
reason
:
if
reason
[:
3
]
!=
'550'
:
raise
IOError
,
(
'ftp error'
,
reason
)
raise
IOError
,
(
'ftp error'
,
reason
),
\
sys
.
exc_traceback
if
not
conn
:
# Try a directory listing
if
file
:
cmd
=
'LIST '
+
file
...
...
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