Rev 5658: thread is already a python module, avoid confusion and use cethread instead. in file:///home/vila/src/bzr/experimental/thread-with-exception/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Feb 10 12:37:28 UTC 2011
At file:///home/vila/src/bzr/experimental/thread-with-exception/
------------------------------------------------------------
revno: 5658
revision-id: v.ladeuil+lp at free.fr-20110210123727-8e0pu4wtlt6fj7nf
parent: v.ladeuil+lp at free.fr-20110210115745-iskdyofe9b64iz47
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: thread-with-exception
timestamp: Thu 2011-02-10 13:37:27 +0100
message:
thread is already a python module, avoid confusion and use cethread instead.
-------------- next part --------------
=== renamed file 'bzrlib/thread.py' => 'bzrlib/cethread.py'
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2011-02-08 15:54:40 +0000
+++ b/bzrlib/tests/__init__.py 2011-02-10 12:37:27 +0000
@@ -3858,7 +3858,7 @@
'bzrlib.tests.test_testament',
'bzrlib.tests.test_textfile',
'bzrlib.tests.test_textmerge',
- 'bzrlib.tests.test_thread',
+ 'bzrlib.tests.test_cethread',
'bzrlib.tests.test_timestamp',
'bzrlib.tests.test_trace',
'bzrlib.tests.test_transactions',
=== renamed file 'bzrlib/tests/test_thread.py' => 'bzrlib/tests/test_cethread.py'
--- a/bzrlib/tests/test_thread.py 2011-02-10 11:57:45 +0000
+++ b/bzrlib/tests/test_cethread.py 2011-02-10 12:37:27 +0000
@@ -17,8 +17,8 @@
import threading
from bzrlib import (
+ cethread,
tests,
- thread,
)
@@ -28,7 +28,7 @@
def do_nothing():
pass
- tt = thread.CatchingExceptionThread(target=do_nothing)
+ tt = cethread.CatchingExceptionThread(target=do_nothing)
tt.start()
tt.join()
@@ -39,7 +39,7 @@
def raise_my_exception():
raise MyException()
- tt = thread.CatchingExceptionThread(target=raise_my_exception)
+ tt = cethread.CatchingExceptionThread(target=raise_my_exception)
tt.start()
self.assertRaises(MyException, tt.join)
@@ -54,7 +54,7 @@
# Now we can raise
raise MyException()
- tt = thread.CatchingExceptionThread(target=raise_my_exception)
+ tt = cethread.CatchingExceptionThread(target=raise_my_exception)
tt.start()
tt.join(timeout=0)
self.assertIs(None, tt.exception)
@@ -73,7 +73,7 @@
# Now we can raise
raise MyException()
- tt = thread.CatchingExceptionThread(target=raise_my_exception,
+ tt = cethread.CatchingExceptionThread(target=raise_my_exception,
sync_event=in_thread)
tt.start()
tt.join(timeout=0)
@@ -89,7 +89,7 @@
control2 = threading.Event()
control3 = threading.Event()
- class TestThread(thread.CatchingExceptionThread):
+ class TestThread(cethread.CatchingExceptionThread):
def __init__(self, *args, **kwargs):
super(TestThread, self).__init__(*args,
@@ -131,7 +131,7 @@
class MyException(Exception):
pass
- class TestThread(thread.CatchingExceptionThread):
+ class TestThread(cethread.CatchingExceptionThread):
def __init__(self, *args, **kwargs):
self.step1 = threading.Event()
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2011-02-08 16:26:23 +0000
+++ b/bzrlib/tests/test_http.py 2011-02-10 12:37:27 +0000
@@ -32,12 +32,12 @@
import bzrlib
from bzrlib import (
bzrdir,
+ cethread,
config,
errors,
osutils,
remote as _mod_remote,
tests,
- thread,
transport,
ui,
)
=== modified file 'bzrlib/tests/test_server.py'
--- a/bzrlib/tests/test_server.py 2011-02-08 16:26:23 +0000
+++ b/bzrlib/tests/test_server.py 2011-02-10 12:37:27 +0000
@@ -22,8 +22,8 @@
from bzrlib import (
+ cethread,
osutils,
- thread,
transport,
urlutils,
)
@@ -243,7 +243,7 @@
raise NotImplementedError
-class TestThread(thread.CatchingExceptionThread):
+class TestThread(cethread.CatchingExceptionThread):
def join(self, timeout=5):
"""Overrides to use a default timeout.
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-02-09 09:14:10 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-02-10 12:37:27 +0000
@@ -118,8 +118,8 @@
* ``CatchingExceptionThread`` (formerly ThreadWithException) has been moved
out of the ``bzrlib.tests`` hierarchy to make it clearer that it can be used
outside of tests. This class makes it easier to track exceptions in threads
- by cacthing them so they can be re-raised in the controlling thread.
- (Vincent Ladeuil)
+ by cacthing them so they can be re-raised in the controlling thread. It's
+ available in the ``bzrlib.cethread`` module. (Vincent Ladeuil)
Testing
*******
More information about the bazaar-commits
mailing list