[pypy-svn] r73126 - pypy/branch/cpython-extension/pypy/module/cpyext

xoraxax at codespeak.net xoraxax at codespeak.net
Mon Mar 29 21:00:39 CEST 2010


Author: xoraxax
Date: Mon Mar 29 21:00:38 2010
New Revision: 73126

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/modsupport.py
Log:
Add cast and correctly pass nullptr.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/modsupport.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/modsupport.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/modsupport.py	Mon Mar 29 21:00:38 2010
@@ -27,10 +27,11 @@
 @cpython_api([rffi.CCHARP, lltype.Ptr(PyMethodDef), rffi.CCHARP,
               PyObject, rffi.INT_real], PyObject, borrowed=False) # we cannot borrow here
 def Py_InitModule4(space, name, methods, doc, w_self, apiver):
+    from pypy.module.cpyext.typeobjectdefs import PyTypeObjectPtr
     modname = rffi.charp2str(name)
     w_mod = PyImport_AddModule(space, modname)
     dict_w = {}
-    convert_method_defs(space, dict_w, methods, None, w_self)
+    convert_method_defs(space, dict_w, methods, lltype.nullptr(PyTypeObjectPtr.TO), w_self)
     for key, w_value in dict_w.items():
         space.setattr(w_mod, space.wrap(key), w_value)
     if doc:
@@ -49,7 +50,7 @@
             if not method.c_ml_name: break
 
             methodname = rffi.charp2str(method.c_ml_name)
-            flags = method.c_ml_flags
+            flags = rffi.cast(lltype.Signed, method.c_ml_flags)
             if pto is None:
                 if flags & METH_CLASS or flags & METH_STATIC:
                     raise OperationError(space.w_ValueError,



More information about the Pypy-commit mailing list