Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r89378:c71c2d504102
Date: 2017-01-05 15:08 +0100
http://bitbucket.org/pypy/pypy/changeset/c71c2d504102/

Log:    CPython fix

diff --git a/rpython/rtyper/lltypesystem/rffi.py 
b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -1320,7 +1320,8 @@
         def __init__(self, string):
             self.ptr = str2charp(string, track_allocation=False)
         def __del__(self):
-            free_charp(self.ptr, track_allocation=False)
+            if free_charp is not None:    # CPython shutdown
+                free_charp(self.ptr, track_allocation=False)
 
     TEST_RAW_ADDR_KEEP_ALIVE = {}
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to