< 2.7 bug in not distinguishing raise from assert

This commit is contained in:
rocky
2016-07-06 19:52:02 -04:00
parent a1dab0fa3a
commit aa65b098a4
3 changed files with 23 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
# 2.6.9 asynccore.py
# Bug in 2.6 was confusing AssertError with an assert statement
# There is special detect code to sort this out based on whether
# we have POP_JUMP_IF_TRUE (2.7) / JUMP_IF_TRUE, POP_TOP
def compact_traceback(tb):
if not tb: # Must have a traceback
raise AssertionError("traceback does not exist")
return