[pypy-svn] r79156 - pypy/branch/reflex-support/pypy/module/cppyy

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Nov 16 17:56:25 CET 2010


Author: cfbolz
Date: Tue Nov 16 17:56:23 2010
New Revision: 79156

Modified:
   pypy/branch/reflex-support/pypy/module/cppyy/converter.py
   pypy/branch/reflex-support/pypy/module/cppyy/executor.py
Log:
try to fix some RPython issues


Modified: pypy/branch/reflex-support/pypy/module/cppyy/converter.py
==============================================================================
--- pypy/branch/reflex-support/pypy/module/cppyy/converter.py	(original)
+++ pypy/branch/reflex-support/pypy/module/cppyy/converter.py	Tue Nov 16 17:56:23 2010
@@ -1,3 +1,4 @@
+import sys
 from pypy.interpreter.error import OperationError
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rlib.rarithmetic import r_singlefloat
@@ -10,7 +11,7 @@
 _converters = {}
 
 class TypeConverter(object):
-    def __init__(self, space, extra=None):
+    def __init__(self, space, extra=-1):
         pass
 
     def _get_fieldptr(self, space, w_obj, offset):
@@ -173,14 +174,11 @@
 
 class ShortPtrConverter(TypeConverter):
     _immutable_ = True
-    def __init__(self, space, detail=None):
-        if detail is None:
-            import sys
-            detail = sys.maxint
+    def __init__(self, space, detail=sys.maxint):
         self.size = detail
     
     def convert_argument(self, space, w_obj):
-        assert "not yet implemented"
+        assert 0, "not yet implemented"
 
     def from_memory(self, space, w_obj, offset):
         # read access, so no copy needed
@@ -206,14 +204,11 @@
 
 class LongPtrConverter(TypeConverter):
     _immutable_ = True
-    def __init__(self, space, detail=None):
-        if detail is None:
-            import sys
-            detail = sys.maxint
+    def __init__(self, space, detail=sys.maxint):
         self.size = detail
     
     def convert_argument(self, space, w_obj):
-        assert "not yet implemented"
+        assert 0, "not yet implemented"
 
     def from_memory(self, space, w_obj, offset):
         # read access, so no copy needed

Modified: pypy/branch/reflex-support/pypy/module/cppyy/executor.py
==============================================================================
--- pypy/branch/reflex-support/pypy/module/cppyy/executor.py	(original)
+++ pypy/branch/reflex-support/pypy/module/cppyy/executor.py	Tue Nov 16 17:56:23 2010
@@ -7,8 +7,7 @@
 
 class FunctionExecutor(object):
     def execute(self, space, func, cppthis, num_args, args):
-        raise NotImplementedError(
-            "abstract base class (actual: %s)" % type(self).__name__)
+        raise NotImplementedError
 
 
 class VoidExecutor(FunctionExecutor):



More information about the Pypy-commit mailing list