[Python-checkins] r88699 - in python/branches/py3k: Lib/_dummy_thread.py Lib/test/test_dummy_thread.py Misc/ACKS Misc/NEWS

antoine.pitrou python-checkins at python.org
Wed Mar 2 00:05:42 CET 2011


Author: antoine.pitrou
Date: Wed Mar  2 00:05:42 2011
New Revision: 88699

Log:
Followup to issue #11140 and r88682: also patch _dummy_thread.
Patch by Aymeric Augustin.



Modified:
   python/branches/py3k/Lib/_dummy_thread.py
   python/branches/py3k/Lib/test/test_dummy_thread.py
   python/branches/py3k/Misc/ACKS
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/_dummy_thread.py
==============================================================================
--- python/branches/py3k/Lib/_dummy_thread.py	(original)
+++ python/branches/py3k/Lib/_dummy_thread.py	Wed Mar  2 00:05:42 2011
@@ -24,11 +24,7 @@
 # imports are done when needed on a function-by-function basis.  Since threads
 # are disabled, the import lock should not be an issue anyway (??).
 
-class error(Exception):
-    """Dummy implementation of _thread.error."""
-
-    def __init__(self, *args):
-        self.args = args
+error = RuntimeError
 
 def start_new_thread(function, args, kwargs={}):
     """Dummy implementation of _thread.start_new_thread().

Modified: python/branches/py3k/Lib/test/test_dummy_thread.py
==============================================================================
--- python/branches/py3k/Lib/test/test_dummy_thread.py	(original)
+++ python/branches/py3k/Lib/test/test_dummy_thread.py	Wed Mar  2 00:05:42 2011
@@ -35,8 +35,8 @@
                         "Lock object did not release properly.")
 
     def test_improper_release(self):
-        #Make sure release of an unlocked thread raises _thread.error
-        self.assertRaises(_thread.error, self.lock.release)
+        #Make sure release of an unlocked thread raises RuntimeError
+        self.assertRaises(RuntimeError, self.lock.release)
 
     def test_cond_acquire_success(self):
         #Make sure the conditional acquiring of the lock works.

Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS	(original)
+++ python/branches/py3k/Misc/ACKS	Wed Mar  2 00:05:42 2011
@@ -35,6 +35,7 @@
 Jason Asbahr
 David Ascher
 Chris AtLee
+Aymeric Augustin
 John Aycock
 Jan-Hein Bührman
 Donovan Baarda

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Wed Mar  2 00:05:42 2011
@@ -44,7 +44,7 @@
 - Issue #11140: Lock.release() now raises a RuntimeError when attempting
   to release an unacquired lock, as claimed in the threading documentation.
   The _thread.error exception is now an alias of RuntimeError.  Patch by
-  Filip Gruszczyński.
+  Filip Gruszczyński.  Patch for _dummy_thread by Aymeric Augustin.
 
 - Issue 8594: ftplib now provides a source_address parameter to specify which
   (address, port) to bind to before connecting.


More information about the Python-checkins mailing list