[pypy-commit] pypy non-null-threadstate: Always return a non-null pointer from PyEval_SaveThread - maybe it's good.

exarkun noreply at buildbot.pypy.org
Thu Mar 8 07:55:30 CET 2012


Author: Jean-Paul Calderone <exarkun at twistedmatrix.com>
Branch: non-null-threadstate
Changeset: r53269:530532093911
Date: 2012-03-07 22:53 -0800
http://bitbucket.org/pypy/pypy/changeset/530532093911/

Log:	Always return a non-null pointer from PyEval_SaveThread - maybe it's
	good.

diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -24,7 +24,7 @@
     when thread support is disabled at compile time.)"""
     if rffi.aroundstate.before:
         rffi.aroundstate.before()
-    return lltype.nullptr(PyThreadState.TO)
+    return rffi.cast(PyThreadState, 1)
 
 @cpython_api([PyThreadState], lltype.Void)
 def PyEval_RestoreThread(space, tstate):


More information about the pypy-commit mailing list