Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: restore Python 3 compat

  • Loading branch information...
commit 88fc3680f9dc5fe0e7c0db1d8937d9a345f4929d 1 parent 73dbeff
@GaelVaroquaux GaelVaroquaux authored
Showing with 10 additions and 5 deletions.
  1. +6 −3 joblib/test/test_parallel.py
  2. +4 −2 sphinx_pypi_upload.py
View
9 joblib/test/test_parallel.py
@@ -82,7 +82,9 @@ def test_simple_parallel():
delayed(square)(x) for x in X)
Parallel(n_jobs=2, verbose=verbose, pre_dispatch=2)(
delayed(square)(x) for x in X)
- except Exception, e:
+ except Exception:
+ # Cannot use 'except as' to maintain Python 2.5 compatibility
+ e = sys.exc_info()[1]
print sys.stdout.getvalue()
print sys.stderr.getvalue()
raise e
@@ -150,8 +152,9 @@ def test_error_capture():
ex = JoblibException
Parallel(n_jobs=1)(
delayed(division)(x, y) for x, y in zip((0, 1), (1, 0)))
- except Exception, e:
- ex = e
+ except Exception:
+ # Cannot use 'except as' to maintain Python 2.5 compatibility
+ ex = sys.exc_info()[1]
nose.tools.assert_false(isinstance(ex, JoblibException))
View
6 sphinx_pypi_upload.py
@@ -13,7 +13,7 @@
Modified for joblib by Gael Varoquaux
"""
-
+import sys
import os
import socket
try:
@@ -120,7 +120,9 @@ def upload(self, filename):
http.putheader('Authorization', auth)
http.endheaders()
http.send(body)
- except socket.error, e:
+ except socket.error:
+ # Cannot use 'except as' to maintain Python 2.5 compatibility
+ e = sys.exc_info()[1]
self.announce(str(e), log.ERROR)
return
Please sign in to comment.
Something went wrong with that request. Please try again.