wlav avatar wlav committed b53fddb

RPython and pylint fixes

Comments (0)

Files changed (2)


 def get_rawobject(space, w_obj):
     if w_obj:
-        from pypy.module.cppyy.interp_cppyy import W_CPPInstance
         w_cpp_instance = space.findattr(w_obj, space.wrap("_cppinstance"))
         if w_cpp_instance:
             return w_cpp_instance.rawobject
 class PtrTypeConverter(ArrayTypeConverter):
     def _get_raw_address(self, space, w_obj, offset):
-        fieldptr = TypeConverter._get_raw_address(self, space, w_obj, offset)
-        ptrptr = rffi.cast(rffi.LONGP, fieldptr)
-        return ptrptr[0]
+        address = TypeConverter._get_raw_address(self, space, w_obj, offset)
+        ptr2ptr = rffi.cast(rffi.LONGP, address)
+        return rffi.cast(rffi.CCHARP, ptr2ptr[0])
 class VoidConverter(TypeConverter):
             raise OperationError(space.w_TypeError,
                                  space.wrap("boolean value should be bool, or integer 1 or 0"))
         if arg:
-           address[0] = '\x01'
+            address[0] = '\x01'
-           address[0] = '\x00'
+            address[0] = '\x00'
 class CharConverter(TypeConverter):
     _immutable = True
         longptr = rffi.cast(rffi.LONGP, address)
         longptr[0] = space.c_int_w(w_value)
-class UnsignedLongConverter(LongConverter):
+class UnsignedLongConverter(TypeConverter):
     _immutable = True
     libffitype = libffi.types.ulong


         self.offset = offset
     def is_static(self):
-        return self.space.wrap(False)
+        return self.space.w_False
     def __get__(self, args_w):
         return self.converter.from_memory(self.space, args_w[0], self.offset)
     def __set__(self, args_w):
         self.converter.to_memory(self.space, args_w[0], args_w[1], self.offset)
-        return None
+        return self.space.w_None
 W_CPPDataMember.typedef = TypeDef(
 class W_CPPStaticDataMember(W_CPPDataMember):
     def is_static(self):
-        return self.space.wrap(True)
+        return self.space.w_True
     def __get__(self, args_w):
         return self.converter.from_memory(self.space, self.space.w_None, self.offset)
     def __set__(self, args_w):
         self.converter.to_memory(self.space, self.space.w_None, args_w[1], self.offset)
-        return None
+        return self.space.w_None
 W_CPPStaticDataMember.typedef = TypeDef(
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.