mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
Get rid of tabnanny's last complaints.
This commit is contained in:
parent
aa2a7a4ae6
commit
5a43e1a90c
1 changed files with 3 additions and 3 deletions
|
@ -320,7 +320,7 @@ class Thread(_Verbose):
|
||||||
|
|
||||||
def __init__(self, group=None, target=None, name=None,
|
def __init__(self, group=None, target=None, name=None,
|
||||||
args=(), kwargs={}, verbose=None):
|
args=(), kwargs={}, verbose=None):
|
||||||
assert group is None, "group argument must be None for now"
|
assert group is None, "group argument must be None for now"
|
||||||
_Verbose.__init__(self, verbose)
|
_Verbose.__init__(self, verbose)
|
||||||
self.__target = target
|
self.__target = target
|
||||||
self.__name = str(name or _newname())
|
self.__name = str(name or _newname())
|
||||||
|
@ -404,14 +404,14 @@ class Thread(_Verbose):
|
||||||
|
|
||||||
def join(self, timeout=None):
|
def join(self, timeout=None):
|
||||||
assert self.__initialized, "Thread.__init__() not called"
|
assert self.__initialized, "Thread.__init__() not called"
|
||||||
assert self.__started, "cannot join thread before it is started"
|
assert self.__started, "cannot join thread before it is started"
|
||||||
assert self is not currentThread(), "cannot join current thread"
|
assert self is not currentThread(), "cannot join current thread"
|
||||||
if __debug__:
|
if __debug__:
|
||||||
if not self.__stopped:
|
if not self.__stopped:
|
||||||
self._note("%s.join(): waiting until thread stops", self)
|
self._note("%s.join(): waiting until thread stops", self)
|
||||||
self.__block.acquire()
|
self.__block.acquire()
|
||||||
if timeout is None:
|
if timeout is None:
|
||||||
while not self.__stopped:
|
while not self.__stopped:
|
||||||
self.__block.wait()
|
self.__block.wait()
|
||||||
if __debug__:
|
if __debug__:
|
||||||
self._note("%s.join(): thread stopped", self)
|
self._note("%s.join(): thread stopped", self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue