mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Add a comment about unreachable code, and fix a typo
This commit is contained in:
parent
8a172b14a3
commit
603acf99d0
1 changed files with 3 additions and 1 deletions
|
@ -176,11 +176,13 @@ class ThreadTests(unittest.TestCase):
|
||||||
except AsyncExc:
|
except AsyncExc:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
# This code is unreachable but it reflects the intent. If we wanted
|
||||||
|
# to be smarter the above loop wouldn't be infinite.
|
||||||
self.fail("AsyncExc not raised")
|
self.fail("AsyncExc not raised")
|
||||||
try:
|
try:
|
||||||
self.assertEqual(result, 1) # one thread state modified
|
self.assertEqual(result, 1) # one thread state modified
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
# The exception was raised to quickly for us to get the result.
|
# The exception was raised too quickly for us to get the result.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# `worker_started` is set by the thread when it's inside a try/except
|
# `worker_started` is set by the thread when it's inside a try/except
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue