[pypy-commit] pypy reflex-support: o) make pyflakes happy

wlav noreply at buildbot.pypy.org
Wed Feb 8 00:59:28 CET 2012


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r52211:ba631ebda607
Date: 2012-02-07 09:56 -0800
http://bitbucket.org/pypy/pypy/changeset/ba631ebda607/

Log:	o) make pyflakes happy

diff --git a/pypy/module/cppyy/converter.py b/pypy/module/cppyy/converter.py
--- a/pypy/module/cppyy/converter.py
+++ b/pypy/module/cppyy/converter.py
@@ -1,7 +1,6 @@
 import sys
 
 from pypy.interpreter.error import OperationError
-from pypy.interpreter.buffer import Buffer
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rlib.rarithmetic import r_singlefloat
 from pypy.rlib import jit, libffi, clibffi
@@ -557,7 +556,6 @@
 _converters = {}         # builtin and custom types
 _a_converters = {}       # array and ptr versions of above
 def get_converter(space, name, default):
-    from pypy.module.cppyy import interp_cppyy
     # The matching of the name to a converter should follow:
     #   1) full, exact match
     #       1a) const-removed match
@@ -572,13 +570,13 @@
     #   1) full, exact match
     try:
         return _converters[name](space, default)
-    except KeyError, k:
+    except KeyError:
         pass
 
     #   1a) const-removed match
     try:
         return _converters[helper.remove_const(name)](space, default)
-    except KeyError, k:
+    except KeyError:
         pass
 
     #   2) match of decorated, unqualified type
@@ -588,7 +586,7 @@
         # array_index may be negative to indicate no size or no size found
         array_size = helper.array_size(name)
         return _a_converters[clean_name+compound](space, array_size)
-    except KeyError, k:
+    except KeyError:
         pass
 
     #   3) accept const ref as by value
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -1,7 +1,5 @@
-import pypy.module.cppyy.capi as capi
-
 from pypy.interpreter.error import OperationError
-from pypy.interpreter.gateway import ObjSpace, interp2app, unwrap_spec
+from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.baseobjspace import Wrappable, W_Root
 
@@ -227,7 +225,7 @@
         assert lltype.typeOf(newthis) == capi.C_OBJECT
         try:
             CPPMethod.call(self, newthis, None, args_w)
-        except Exception, e:
+        except Exception:
             capi.c_deallocate(self.cpptype.handle, newthis)
             raise
         return new_instance(self.space, w_type, self.cpptype, newthis, True)
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
@@ -74,7 +74,7 @@
     else:                                        # return instance
         try:
             cppclass = get_cppclass(rettype)
-        except AttributeError, e:
+        except AttributeError:
             import warnings
             warnings.warn("class %s unknown: no data member access" % rettype,
                           RuntimeWarning)


More information about the pypy-commit mailing list