mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-25 01:02:19 +00:00
Partial fix for #1230: js2py issue under Python 3.8+
This commit is contained in:
parent
b291746a49
commit
240a3759cf
1 changed files with 10 additions and 1 deletions
|
@ -115,6 +115,15 @@ def append_arguments(code_obj, new_locals):
|
|||
code_obj.co_freevars, code_obj.co_cellvars)
|
||||
|
||||
# Done modifying codestring - make the code object
|
||||
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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue