Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r63537:42bcb364d381
Date: 2013-04-19 15:30 -0700
http://bitbucket.org/pypy/pypy/changeset/42bcb364d381/
Log: compare to a cast 0 instead of relying on implicit null
diff --git a/pypy/module/cppyy/executor.py b/pypy/module/cppyy/executor.py
--- a/pypy/module/cppyy/executor.py
+++ b/pypy/module/cppyy/executor.py
@@ -132,10 +132,10 @@
def execute(self, space, cppmethod, cppthis, num_args, args):
lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args)
ccpresult = rffi.cast(rffi.CCHARP, lresult)
- if ccpresult:
- result = rffi.charp2str(ccpresult) # TODO: make it a choice to
free
- return space.wrap(result)
- return space.wrap('')
+ if ccpresult == rffi.cast(rffi.CCHARP, 0):
+ return space.wrap("")
+ result = rffi.charp2str(ccpresult) # TODO: make it a choice to free
+ return space.wrap(result)
class ConstructorExecutor(FunctionExecutor):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit