Armin Rigo avatar Armin Rigo committed 710f8fc

Python 3.

Comments (0)

Files changed (3)

cffi/ffiplatform.py

 
 try:
     int_or_long = (int, long)
+    import cStringIO
 except NameError:
     int_or_long = int      # Python 3
+    import io as cStringIO
 
 def _flatten(x, f):
     if isinstance(x, str):
             "the keywords to verify() contains unsupported object %r" % (x,))
 
 def flatten(x):
-    import cStringIO
     f = cStringIO.StringIO()
     _flatten(x, f)
     return f.getvalue()

cffi/vengine_cpy.py

                     "not implemented in verify(): %r" % name)
             try:
                 method(tp, realname)
-            except Exception, e:
+            except Exception as e:
                 model.attach_exception_info(e, name)
                 raise
 
             method = getattr(self, '_%s_cpy_%s' % (step_name, kind))
             try:
                 method(tp, realname, module, **kwds)
-            except Exception, e:
+            except Exception as e:
                 model.attach_exception_info(e, name)
                 raise
 

cffi/vengine_gen.py

                     "not implemented in verify(): %r" % name)
             try:
                 method(tp, realname)
-            except Exception, e:
+            except Exception as e:
                 model.attach_exception_info(e, name)
                 raise
 
             method = getattr(self, '_%s_gen_%s' % (step_name, kind))
             try:
                 method(tp, realname, module, **kwds)
-            except Exception, e:
+            except Exception as e:
                 model.attach_exception_info(e, name)
                 raise
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.