Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r79736:32a41767a897
Date: 2015-09-21 10:31 +0200
http://bitbucket.org/pypy/pypy/changeset/32a41767a897/

Log:    Vague attempt at using a "pypy --translationmodules" to translate:
        there is no thread module in the host python then

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -280,7 +280,11 @@
 class ThreadLocalField(object):
     def __init__(self, FIELDTYPE, fieldname, loop_invariant=False):
         "NOT_RPYTHON: must be prebuilt"
-        from thread import _local
+        try:
+            from thread import _local
+        except ImportError:
+            class _local(object):
+                pass
         self.FIELDTYPE = FIELDTYPE
         self.fieldname = fieldname
         self.local = _local()      # <- NOT_RPYTHON
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to