You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix pypy semantic action bug in CALL_METHOD
This commit is contained in:
BIN
test/bytecode_pypy2.7/02_call_method.pyc
Normal file
BIN
test/bytecode_pypy2.7/02_call_method.pyc
Normal file
Binary file not shown.
4
test/simple_source/bug_pypy27/02_call_method.py
Normal file
4
test/simple_source/bug_pypy27/02_call_method.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# Bug in PyPy was not hacndling CALL_METHOD_xxx like
|
||||
# CALL_FUNCTION_XXX
|
||||
def truncate(self, size=None):
|
||||
self.db.put(self.key, '', txn=self.txn, dlen=self.len - size, doff=size)
|
@@ -1730,8 +1730,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
%c, %C, and so on.
|
||||
"""
|
||||
|
||||
# self.println("-----")
|
||||
# self.print(startnode)
|
||||
# self.println("----> ", startnode.type)
|
||||
|
||||
fmt = entry[0]
|
||||
arg = 1
|
||||
@@ -1850,11 +1849,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
continue
|
||||
op = k[ :k.rfind('_') ]
|
||||
|
||||
if k == 'CALL_METHOD':
|
||||
if k.startswith('CALL_METHOD'):
|
||||
# This happens in PyPy only
|
||||
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
||||
|
||||
if op == 'CALL_FUNCTION':
|
||||
elif op == 'CALL_FUNCTION':
|
||||
TABLE_R[k] = ('%c(%P)', 0, (1, -1, ', ', 100))
|
||||
elif op in ('CALL_FUNCTION_VAR',
|
||||
'CALL_FUNCTION_VAR_KW', 'CALL_FUNCTION_KW'):
|
||||
|
Reference in New Issue
Block a user