[pypy-commit] pypy stm: Hacks to make checkmodule() work.

arigo noreply at buildbot.pypy.org
Sun Jan 22 11:29:34 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm
Changeset: r51634:69e39e76c0d2
Date: 2012-01-22 11:29 +0100
http://bitbucket.org/pypy/pypy/changeset/69e39e76c0d2/

Log:	Hacks to make checkmodule() work.

diff --git a/pypy/module/transaction/__init__.py b/pypy/module/transaction/__init__.py
--- a/pypy/module/transaction/__init__.py
+++ b/pypy/module/transaction/__init__.py
@@ -18,3 +18,8 @@
     def startup(self, space):
         from pypy.module.transaction import interp_transaction
         interp_transaction.state.startup(space)
+
+    def translating_for_checkmodule(self, space):
+        from pypy.module.transaction import interp_transaction
+        interp_transaction.state.space = space
+        interp_transaction.state._freeze_ = lambda: None   # hack!
diff --git a/pypy/module/transaction/interp_transaction.py b/pypy/module/transaction/interp_transaction.py
--- a/pypy/module/transaction/interp_transaction.py
+++ b/pypy/module/transaction/interp_transaction.py
@@ -19,6 +19,8 @@
         self.ll_lock = threadintf.null_ll_lock
         self.ll_no_tasks_pending_lock = threadintf.null_ll_lock
         self.ll_unfinished_lock = threadintf.null_ll_lock
+        self.main_thread_id = 0
+        self.w_error = None
 
     def startup(self, space):
         self.space = space
diff --git a/pypy/objspace/fake/checkmodule.py b/pypy/objspace/fake/checkmodule.py
--- a/pypy/objspace/fake/checkmodule.py
+++ b/pypy/objspace/fake/checkmodule.py
@@ -10,5 +10,7 @@
     module = mod.Module(space, W_Root())
     for name in module.loaders:
         module._load_lazily(space, name)
+    if hasattr(module, 'translating_for_checkmodule'):
+        module.translating_for_checkmodule(space)
     #
     space.translates(**{'translation.list_comprehension_operations':True})


More information about the pypy-commit mailing list