Less dishonest COME_FROMs

Addresses all of the problems seen in 3.7 datetime.py.

However we limit COME_FROMs only to forward jumps, not back (which in the case of Python code right now means looping) jumps.
This commit is contained in:
rocky
2019-05-13 22:59:24 -04:00
parent ce9270dda0
commit 44e1288e2f
3 changed files with 12 additions and 2 deletions

View File

@@ -1433,7 +1433,7 @@ class SourceWalker(GenericASTTraversal, object):
assert node[n].kind.startswith('CALL_FUNCTION')
if node[n].kind.startswith('CALL_FUNCTION_KW'):
# 3.6+ starts does this
# 3.6+ starts doing this
kwargs = node[n-1].attr
assert isinstance(kwargs, tuple)
i = n - (len(kwargs)+1)