[pypy-svn] r46609 - pypy/dist/pypy/module/thread
arigo at codespeak.net
arigo at codespeak.net
Sat Sep 15 10:30:13 CEST 2007
Author: arigo
Date: Sat Sep 15 10:30:13 2007
New Revision: 46609
Modified:
pypy/dist/pypy/module/thread/error.py
pypy/dist/pypy/module/thread/gil.py
pypy/dist/pypy/module/thread/os_lock.py
pypy/dist/pypy/module/thread/os_thread.py
Log:
Make the flow space happy.
Modified: pypy/dist/pypy/module/thread/error.py
==============================================================================
--- pypy/dist/pypy/module/thread/error.py (original)
+++ pypy/dist/pypy/module/thread/error.py Sat Sep 15 10:30:13 2007
@@ -1,6 +1,6 @@
from pypy.interpreter.error import OperationError
-def reraise_thread_error(space, msg):
+def wrap_thread_error(space, msg):
w_module = space.getbuiltinmodule('thread')
w_error = space.getattr(w_module, space.wrap('error'))
- raise OperationError(w_error, space.wrap(msg))
+ return OperationError(w_error, space.wrap(msg))
Modified: pypy/dist/pypy/module/thread/gil.py
==============================================================================
--- pypy/dist/pypy/module/thread/gil.py (original)
+++ pypy/dist/pypy/module/thread/gil.py Sat Sep 15 10:30:13 2007
@@ -8,7 +8,7 @@
# from time to time, using the executioncontext's XXX
from pypy.module.thread import ll_thread as thread
-from pypy.module.thread.error import reraise_thread_error
+from pypy.module.thread.error import wrap_thread_error
from pypy.interpreter.miscutils import Action
from pypy.module.thread.threadlocals import OSThreadLocals
from pypy.rlib.objectmodel import invoke_around_extcall
@@ -23,7 +23,7 @@
try:
self.GIL = thread.allocate_lock_NOAUTO()
except thread.error:
- reraise_thread_error(space, "can't allocate GIL")
+ raise wrap_thread_error(space, "can't allocate GIL")
self.enter_thread(space) # setup the main thread
# add the GIL-releasing callback as an action on the space
space.pending_actions.append(GILReleaseAction(self))
Modified: pypy/dist/pypy/module/thread/os_lock.py
==============================================================================
--- pypy/dist/pypy/module/thread/os_lock.py (original)
+++ pypy/dist/pypy/module/thread/os_lock.py Sat Sep 15 10:30:13 2007
@@ -3,7 +3,7 @@
"""
from pypy.module.thread import ll_thread as thread
-from pypy.module.thread.error import reraise_thread_error
+from pypy.module.thread.error import wrap_thread_error
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.gateway import ObjSpace, interp2app
from pypy.interpreter.typedef import TypeDef
@@ -33,7 +33,7 @@
try:
self.lock = thread.allocate_lock()
except thread.error:
- reraise_thread_error(space, "out of resources")
+ raise wrap_thread_error(space, "out of resources")
def descr_lock_acquire(self, space, waitflag=1):
"""Lock the lock. Without argument, this blocks if the lock is already
@@ -53,7 +53,7 @@
try:
self.lock.release()
except thread.error:
- reraise_thread_error(space, "release unlocked lock")
+ raise wrap_thread_error(space, "release unlocked lock")
def descr_lock_locked(self, space):
"""Return whether the lock is in the locked state."""
Modified: pypy/dist/pypy/module/thread/os_thread.py
==============================================================================
--- pypy/dist/pypy/module/thread/os_thread.py (original)
+++ pypy/dist/pypy/module/thread/os_thread.py Sat Sep 15 10:30:13 2007
@@ -3,7 +3,7 @@
"""
from pypy.module.thread import ll_thread as thread
-from pypy.module.thread.error import reraise_thread_error
+from pypy.module.thread.error import wrap_thread_error
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import NoneNotWrapped
from pypy.interpreter.gateway import ObjSpace, W_Root, Arguments
@@ -85,7 +85,7 @@
try:
ident = thread.start_new_thread(Bootstrapper.bootstrap, (boot,))
except thread.error:
- reraise_thread_error(space, "can't start new thread")
+ raise wrap_thread_error(space, "can't start new thread")
return space.wrap(ident)
More information about the Pypy-commit
mailing list