rimessa libreria pyjsparser e aggiornata js2py

This commit is contained in:
marco
2019-12-29 11:41:27 +01:00
parent 1ab7044d22
commit 5ce0723c27
13 changed files with 3972 additions and 98 deletions
+10 -1
View File
@@ -115,7 +115,16 @@ def append_arguments(code_obj, new_locals):
code_obj.co_freevars, code_obj.co_cellvars)
# Done modifying codestring - make the code object
return types.CodeType(*args)
if hasattr(code_obj, "replace"):
# Python 3.8+
return code_obj.replace(
co_argcount=co_argcount + new_locals_len,
co_nlocals=code_obj.co_nlocals + new_locals_len,
co_code=code,
co_names=names,
co_varnames=varnames)
else:
return types.CodeType(*args)
def instructions(code_obj):