Commits

Armin Rigo  committed 7036ba9

More import fixes

  • Participants
  • Parent commits 2607c50
  • Branches stm-thread-2

Comments (0)

Files changed (6)

File rpython/translator/stm/jitdriver.py

 from rpython.rtyper.annlowlevel import (MixLevelHelperAnnotator,
                                       cast_base_ptr_to_instance)
 from rpython.rlib import rstm
-from pypy.tool.sourcetools import compile2
+from rpython.tool.sourcetools import compile2
 
 
 def find_jit_merge_point(graph):

File rpython/translator/stm/stmgcintf.py

-import py
-from pypy.tool.autopath import pypydir
+import py, os
 from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rlib.rarithmetic import LONG_BIT
+from rpython.conftest import cdir as cdir2
 
 
-cdir = py.path.local(pypydir) / 'translator' / 'stm'
-cdir2 = py.path.local(pypydir) / 'translator' / 'c'
+cdir = os.path.abspath(os.path.join(cdir2, '..', 'stm'))
 
 eci = ExternalCompilationInfo(
     include_dirs = [cdir, cdir2],

File rpython/translator/stm/test/targetdemo2.py

 import time
-from pypy.module.thread import ll_thread
+from rpython.rlib import rthread
 from rpython.rlib import rstm, jit
 from rpython.rlib.objectmodel import invoke_around_extcall, we_are_translated
 from rpython.rlib.objectmodel import compute_identity_hash
 
     def __init__(self, i):
         self.index = i
-        self.finished_lock = ll_thread.allocate_lock()
+        self.finished_lock = rthread.allocate_lock()
         self.finished_lock.acquire(True)
 
     def run(self):
     @staticmethod
     def setup():
         if bootstrapper.lock is None:
-            bootstrapper.lock = ll_thread.allocate_lock()
+            bootstrapper.lock = rthread.allocate_lock()
 
     @staticmethod
     def reinit():
         # Note that when this runs, we already hold the GIL.  This is ensured
         # by rffi's callback mecanism: we are a callback for the
         # c_thread_start() external function.
-        ll_thread.gc_thread_start()
+        rthread.gc_thread_start()
         args = bootstrapper.args
         bootstrapper.release()
         # run!
         try:
             args.run()
         finally:
-            ll_thread.gc_thread_die()
+            rthread.gc_thread_die()
 
     @staticmethod
     def acquire(args):
 def start_thread(args):
     bootstrapper.acquire(args)
     try:
-        ll_thread.gc_thread_prepare()     # (this has no effect any more)
-        ident = ll_thread.start_new_thread(bootstrapper.bootstrap, ())
+        rthread.gc_thread_prepare()     # (this has no effect any more)
+        ident = rthread.start_new_thread(bootstrapper.bootstrap, ())
     except Exception, e:
         bootstrapper.release()     # normally called by the new thread
         raise

File rpython/translator/stm/test/test_inevitable.py

 from rpython.rtyper.test import test_llinterp
 from rpython.rtyper.test.test_llinterp import get_interpreter, clear_tcache
 from rpython.translator.stm.inevitable import insert_turn_inevitable
-from pypy.conftest import option
+from rpython.conftest import option
 
 
 class LLSTMInevFrame(LLFrame):

File rpython/translator/stm/test/test_stmgcintf.py

 import os
-from pypy.tool import autopath
-from pypy.tool.udir import udir
+from rpython.tool.udir import udir
 
 
 def test_all():
     executable = str(udir.join('test_stmgcintf'))
     prevdir = os.getcwd()
-    thisdir = os.path.join(autopath.pypydir, 'translator', 'stm', 'test')
+    thisdir = os.path.dirname(__file__)
     try:
         os.chdir(thisdir)
         exitcode = os.system(

File rpython/translator/stm/test/transform2_support.py

 from rpython.rtyper.test.test_llinterp import get_interpreter, clear_tcache
 from rpython.translator.stm.transform2 import STMTransformer
 from rpython.translator.stm.writebarrier import MORE_PRECISE_CATEGORIES
-from pypy.conftest import option
+from rpython.conftest import option
 
 
 class _stmptr(lltype._ptr):