summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2013-02-07 19:58:43 +0100
committerArmin Rigo <arigo@tunes.org>2013-02-07 19:58:43 +0100
commita9ca88985b485b52af6695defd4ab14bb399a986 (patch)
treef82413611ac6bbafb29f721e3b36dfe46ec03ad9
parentc0fc1876fea0d2b86b3d067fc7ee4c7f332c8e93 (diff)
downloadcffi-a9ca88985b485b52af6695defd4ab14bb399a986.tar.gz
Python 3 compat
-rw-r--r--cffi/api.py6
-rw-r--r--testing/test_zintegration.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/cffi/api.py b/cffi/api.py
index d1e6f7d..ad293f2 100644
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -7,6 +7,12 @@ except NameError:
from collections import Callable
callable = lambda x: isinstance(x, Callable)
+try:
+ basestring
+except NameError:
+ # Python 3.x
+ basestring = str
+
class FFIError(Exception):
pass
diff --git a/testing/test_zintegration.py b/testing/test_zintegration.py
index af7984a..18454ee 100644
--- a/testing/test_zintegration.py
+++ b/testing/test_zintegration.py
@@ -9,7 +9,7 @@ def create_venv(name):
subprocess.check_call(['virtualenv', '--distribute',
'-p', sys.executable,
str(tmpdir)])
- except OSError, e:
+ except OSError as e:
py.test.skip("Cannot execute virtualenv: %s" % (e,))
site_packages = None