You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Fix 3.5 if..pass bug
Update HISTORY.MD to include Dan Pascu. Some minor doc corrections
This commit is contained in:
BIN
test/bytecode_3.5/10_if_pass.pyc
Normal file
BIN
test/bytecode_3.5/10_if_pass.pyc
Normal file
Binary file not shown.
23
test/simple_source/branching/10_if_pass.py
Normal file
23
test/simple_source/branching/10_if_pass.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Bug in Python 3.5 in disentangling jump "over" a "pass" statement
|
||||
# or a jump to the next instruction.
|
||||
|
||||
# On Python 3.5 you should get
|
||||
# compare ::= expr expr COMPARE_OP
|
||||
# ...
|
||||
# jmp_false ::= POP_JUMP_IF_FALSE
|
||||
# ...
|
||||
|
||||
from weakref import ref
|
||||
|
||||
class _localimpl:
|
||||
|
||||
def create_dict(self, thread):
|
||||
"""Create a new dict for the current thread, and return it."""
|
||||
localdict = {}
|
||||
idt = id(thread)
|
||||
def thread_deleted(_, idt=idt):
|
||||
local = wrlocal()
|
||||
if local is not None: # bug is here
|
||||
pass # jumping over here
|
||||
wrlocal = ref(self, local_deleted)
|
||||
return localdict
|
Reference in New Issue
Block a user