Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 061ce7f

Browse files
committed
Fixed test_urllibnet
1 parent 7e18254 commit 061ce7f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_urllibnet.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
def _open_with_retry(func, host, *args, **kwargs):
1414
# Connecting to remote hosts is flaky. Make it more robust
1515
# by retrying the connection several times.
16+
last_exc = None
1617
for i in range(3):
1718
try:
1819
return func(host, *args, **kwargs)
19-
except IOError, last_exc:
20+
except IOError as err:
21+
last_exc = err
2022
continue
2123
except:
2224
raise

0 commit comments

Comments
 (0)