Code review comment for lp://staging/~roadmr/checkbox/1097866-thread-arguments

Revision history for this message
Jeff Marcom (jeffmarcom) wrote :

I'd rather see the following personally:
class REThread(threading.Thread):
    '''Enhanced threading.Thread which can deliver a return value and propagate
    exceptions from the called thread to the calling thread.'''

    def __init__(self, group=None, target=None, name=None, args=(), kwargs={},
            verbose=None):
        '''Initialize Thread, identical to threading.Thread.__init__().'''
        #Note that due to api differences in python (verbose disappeared
        #at some point before 3.3 and got replaced by daemon), we just
        #ignore the verbose attribute. It's not used anywhere in checkbox
        #so this is safe for our purposes.
        self.__target = target
        self.__args = args
        self.__kwargs = kwargs
        self._retval = None
        self._exception = None

        threading.Thread.__init__(self)

Let me know if you think this won't work

review: Needs Information

« Back to merge proposal