Author: Armin Rigo <ar...@tunes.org>
Branch: reverse-debugger
Changeset: r85555:0efcaa2d00e4
Date: 2016-07-05 09:10 +0200
http://bitbucket.org/pypy/pypy/changeset/0efcaa2d00e4/

Log:    Generally useful to run most pypy tests on top of a thread-less pypy

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -96,15 +96,17 @@
     if we_are_translated():
         return tlfield_thread_ident.getraw()
     else:
-        import thread
-        return thread.get_ident()
+        try:
+            import thread
+            return thread.get_ident()
+        except ImportError:
+            return 1
 
 def get_or_make_ident():
     if we_are_translated():
         return tlfield_thread_ident.get_or_make_raw()
     else:
-        import thread
-        return thread.get_ident()
+        return get_ident()
 
 @specialize.arg(0)
 def start_new_thread(x, y):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to