/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/cethread.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
import threading
21
21
 
 
22
from .sixish import (
 
23
    reraise,
 
24
)
 
25
 
22
26
 
23
27
class CatchingExceptionThread(threading.Thread):
24
28
    """A thread that keeps track of exceptions.
43
47
        self.ignored_exceptions = None # see set_ignored_exceptions
44
48
        self.lock = threading.Lock()
45
49
 
46
 
    # compatibility thunk for python-2.4 and python-2.5...
47
 
    if sys.version_info < (2, 6):
48
 
        name = property(threading.Thread.getName, threading.Thread.setName)
49
 
 
50
50
    def set_sync_event(self, event):
51
51
        """Set the ``sync_event`` event used to synchronize exception catching.
52
52
 
146
146
            if (self.ignored_exceptions is None
147
147
                or not self.ignored_exceptions(exc_value)):
148
148
                # Raise non ignored exceptions
149
 
                raise exc_class, exc_value, exc_tb
 
149
                reraise(exc_class, exc_value, exc_tb)
150
150
 
151
151
    def pending_exception(self):
152
152
        """Raise the caught exception.