diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-01 23:05:42 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-01 23:05:42 (GMT) |
commit | 819c40ff35aeead0f78c71e18efdc634ffb7b187 (patch) | |
tree | 5536386865d20e18a25c768d86f34d5275dd7c3c | |
parent | 2512a8b62e32d0b7c51b484a32bb770bd4c2a903 (diff) | |
download | cpython-819c40ff35aeead0f78c71e18efdc634ffb7b187.zip cpython-819c40ff35aeead0f78c71e18efdc634ffb7b187.tar.gz cpython-819c40ff35aeead0f78c71e18efdc634ffb7b187.tar.bz2 |
Followup to issue #11140 and r88682: also patch _dummy_thread.
Patch by Aymeric Augustin.
-rw-r--r-- | Lib/_dummy_thread.py | 6 | ||||
-rw-r--r-- | Lib/test/test_dummy_thread.py | 4 | ||||
-rw-r--r-- | Misc/ACKS | 1 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/Lib/_dummy_thread.py b/Lib/_dummy_thread.py index ed50520..13b1f26 100644 --- a/Lib/_dummy_thread.py +++ b/Lib/_dummy_thread.py @@ -24,11 +24,7 @@ TIMEOUT_MAX = 2**31 # 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(). diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py index c61078d..2fafe1d 100644 --- a/Lib/test/test_dummy_thread.py +++ b/Lib/test/test_dummy_thread.py @@ -35,8 +35,8 @@ class LockTests(unittest.TestCase): "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. @@ -35,6 +35,7 @@ Jon Anglin Jason Asbahr David Ascher Chris AtLee +Aymeric Augustin John Aycock Jan-Hein Bührman Donovan Baarda @@ -44,7 +44,7 @@ Library - 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. |