Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r71140:cf6744cc5576
Date: 2014-04-29 17:03 -0700
http://bitbucket.org/pypy/pypy/changeset/cf6744cc5576/
Log: py3k compat
diff --git a/pypy/module/cppyy/pythonify.py b/pypy/module/cppyy/pythonify.py
--- a/pypy/module/cppyy/pythonify.py
+++ b/pypy/module/cppyy/pythonify.py
@@ -1,6 +1,7 @@
# NOT_RPYTHON
# do not load cppyy here, see _init_pythonify()
-import types, sys
+import types
+import sys
# For now, keep namespaces and classes separate as namespaces are extensible
@@ -11,7 +12,7 @@
def __getattr__(self, name):
try:
return get_pycppitem(self, name) # will cache on self
- except Exception, e:
+ except Exception as e:
raise AttributeError("%s object has no attribute '%s' (details:
%s)" %
(self, name, str(e)))
@@ -309,7 +310,7 @@
return self._getitem__unchecked(idx)
def python_style_sliceable_getitem(self, slice_or_idx):
- if type(slice_or_idx) == types.SliceType:
+ if type(slice_or_idx) == slice:
nseq = self.__class__()
nseq += [python_style_getitem(self, i) \
for i in range(*slice_or_idx.indices(len(self)))]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit