Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 134adb3 commit 75a1cbdCopy full SHA for 75a1cbd
1 file changed
Lib/test/support/socket_helper.py
@@ -259,6 +259,10 @@ def filter_error(err):
259
# raise OSError('socket error', msg) from msg
260
elif len(a) >= 2 and isinstance(a[1], OSError):
261
err = a[1]
262
+ # The error can also be wrapped as __cause__:
263
+ # raise URLError(f"ftp error: {exp}") from exp
264
+ elif isinstance(err, urllib.error.URLError) and err.__cause__:
265
+ err = err.__cause__
266
else:
267
break
268
filter_error(err)
0 commit comments