[pypy-svn] r31165 - in pypy/dist/pypy: module/_stackless objspace/cclp objspace/test

auc at codespeak.net auc at codespeak.net
Tue Aug 8 16:20:11 CEST 2006


Author: auc
Date: Tue Aug  8 16:20:07 2006
New Revision: 31165

Modified:
   pypy/dist/pypy/module/_stackless/clonable.py
   pypy/dist/pypy/objspace/cclp/scheduler.py
   pypy/dist/pypy/objspace/cclp/space.py
   pypy/dist/pypy/objspace/test/test_logicobjspace.py
Log:
transl. fix


Modified: pypy/dist/pypy/module/_stackless/clonable.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/clonable.py	(original)
+++ pypy/dist/pypy/module/_stackless/clonable.py	Tue Aug  8 16:20:07 2006
@@ -32,7 +32,7 @@
              space.getexecutioncontext().subcontext_new(self)
         self._dead = False
         self._next = self._prev = self
-        self._cspace = None
+        self._cspace = space.w_None
 
     def hello(self):
         if we_are_translated():

Modified: pypy/dist/pypy/objspace/cclp/scheduler.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/scheduler.py	(original)
+++ pypy/dist/pypy/objspace/cclp/scheduler.py	Tue Aug  8 16:20:07 2006
@@ -89,7 +89,7 @@
             self.display_head()
         thread._next = thread._prev = None
         # cspace/threads account mgmt
-        if thread._cspace is not None:
+        if thread._cspace is not self.space.w_None:
             count = self.dec_live_thread_count(thread._cspace)
             if count == 0:
                 del self._per_space_live_threads[thread._cspace]
@@ -208,7 +208,7 @@
         "insert 'thread' at end of running queue"
         assert isinstance(thread, ClonableCoroutine)
         # cspace account mgmt
-        if thread._cspace != None:
+        if thread._cspace != self.space.w_None:
             self._per_space_live_threads.get(thread._cspace, 0)
             self.inc_live_thread_count(thread._cspace)
         self._chain_insert(thread)
@@ -226,7 +226,7 @@
         blocked.append(thread)
         self._blocked[thread] = True
         # cspace accounting
-        if thread._cspace is not None:
+        if thread._cspace is not self.space.w_None:
             self.dec_live_thread_count(thread._cspace)
 
     def unblock_on(self, w_var):
@@ -240,7 +240,7 @@
         for thr in blocked:
             del self._blocked[thr]
             # cspace accounting
-            if thr._cspace is not None:
+            if thr._cspace is not self.space.w_None:
                 self.inc_live_thread_count(thr._cspace)
 
     def add_to_blocked_byneed(self, w_var, thread):
@@ -255,7 +255,7 @@
         blocked.append(thread)
         self._blocked[thread] = True
         # cspace accounting
-        if thread._cspace is not None:
+        if thread._cspace is not self.space.w_None:
             self.dec_live_thread_count(thread._cspace)
 
     def unblock_byneed_on(self, w_var):
@@ -271,7 +271,7 @@
         for thr in blocked:
             del self._blocked[thr]
             # cspace accounting
-            if thr._cspace is not None:
+            if thr._cspace is not self.space.w_None:
                 self.inc_live_thread_count(thr._cspace)
             
 

Modified: pypy/dist/pypy/objspace/cclp/space.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/space.py	(original)
+++ pypy/dist/pypy/objspace/cclp/space.py	Tue Aug  8 16:20:07 2006
@@ -34,7 +34,7 @@
     assert isinstance(w_n, W_IntObject)
     n = space.int_w(w_n)
     cspace = ClonableCoroutine.w_getcurrent(space)._cspace
-    if cspace != None:
+    if cspace != space.w_None:
         assert isinstance(cspace, W_CSpace)
         return cspace.choose(n)
     raise OperationError(space.w_RuntimeError,
@@ -45,9 +45,9 @@
 
 class W_CSpace(baseobjspace.Wrappable):
 
-    def __init__(self, space, thread, parent=None):
+    def __init__(self, space, thread, parent):
         assert isinstance(thread, ClonableCoroutine)
-        assert (parent is None) or isinstance(parent, W_CSpace)
+        assert (parent is space.w_None) or isinstance(parent, W_CSpace)
         self.space = space # the object space ;-)
         self.parent = parent
         self.main_thread = thread

Modified: pypy/dist/pypy/objspace/test/test_logicobjspace.py
==============================================================================
--- pypy/dist/pypy/objspace/test/test_logicobjspace.py	(original)
+++ pypy/dist/pypy/objspace/test/test_logicobjspace.py	Tue Aug  8 16:20:07 2006
@@ -739,5 +739,3 @@
         schedule()
         assert len(sched_all()['threads']) == 1
 
-
-    



More information about the Pypy-commit mailing list