Log message for revision 74043:
  Merged trunk r73189:73190 into 2.9 branch.
  
  Protect against setNumberOfThreads disappearing after first use.
  

Changed:
  U   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/threadutils.py
  U   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py

-=-
Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/threadutils.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/threadutils.py    
2007-04-08 23:44:28 UTC (rev 74042)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/threadutils.py    
2007-04-09 14:06:29 UTC (rev 74043)
@@ -22,6 +22,15 @@
 dummyLOG = StringIO()
 
 
+def setNumberOfThreads(number_of_threads):
+    '''Sets number of ZServer threads.'''
+    try:
+        from ZServer.PubCore import setNumberOfThreads
+        setNumberOfThreads(number_of_threads)
+    except ImportError:
+        pass
+
+
 def zserverRunner(host, port, log=None):
     '''Runs an HTTP ZServer on host:port.'''
     from ZServer import logger, asyncore

Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py  2007-04-08 
23:44:28 UTC (rev 74042)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py  2007-04-09 
14:06:29 UTC (rev 74043)
@@ -115,7 +115,7 @@
     if _Z2HOST is None:
         _Z2HOST = '127.0.0.1'
         _Z2PORT = random.choice(range(55000, 55500))
-        from ZServer import setNumberOfThreads
+        from threadutils import setNumberOfThreads
         setNumberOfThreads(number_of_threads)
         from threadutils import QuietThread, zserverRunner
         t = QuietThread(target=zserverRunner, args=(_Z2HOST, _Z2PORT, log))

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to