Garrett Berg added the comment:
I found a workaround, and probably the reason this has not been detected before:
import sys
def doclear2()
try:
1/0
except ZeroDivisionError:
sys.exc_clear()
try:
1/0
except ZeroDivisionError
New submission from Garrett Berg :
# Summary
In python (2 or 3) it should always be valid to have a bare *raise* statement
in an exception block.
try:
do_something()
except SomeException:
do_cleanup()
raise # always reraises SomeException with original stack
Garrett Berg added the comment:
I forgot to post this:
python --version
Garrett Berg added the comment:
Gave it a shot!
--
keywords: +patch
pull_requests: +4620
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Garrett Berg added the comment:
It may be desirable to change:
> Once awoken, decrement the counter by 1.
to
> Once awoke, decrement the counter (which is guaranteed to be positive) by 1.
Although this could be considered obvious since the counter can never go below
Garrett Berg added the comment:
Also, is "The order in which threads are awoken should not be relied on"
actually true? Would it not be up to the OS specific scheduler? For instance,
wouldn't the POSIX scheduler use a priority que
New submission from Garrett Berg :
The definition of threading.Semaphore is confusing (for all versions of python
docs)
https://docs.python.org/2/library/threading.html#semaphore-objects
acquire([blocking])
It currently states the following:
> When invoked without arguments: if