Skip to content

KeyError in python3.12.0 #317

Description

@LeadroyaL
# python --version
Python 3.12.0

# pipdeptree
Js2Py==0.74
├── pyjsparser [required: >=2.5.1, installed: 2.7.1]
├── six [required: >=1.10, installed: 1.16.0]
└── tzlocal [required: >=1.2, installed: 5.1]
    └── tzdata [required: Any, installed: 2023.3]

# cat .\test.py
import js2py
Traceback (most recent call last):
  File "D:\PycharmProjects\test.py", line 1, in <module>
    import js2py
  File "D:\Python\Python312\Lib\site-packages\js2py\__init__.py", line 72, in <module>
    from .base import PyJsException
  File "D:\Python\Python312\Lib\site-packages\js2py\base.py", line 2965, in <module>
    @Js
     ^^
  File "D:\Python\Python312\Lib\site-packages\js2py\base.py", line 165, in Js
    return PyJsFunction(val, FunctionPrototype)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Python312\Lib\site-packages\js2py\base.py", line 1377, in __init__
    cand = fix_js_args(func)
           ^^^^^^^^^^^^^^^^^
  File "D:\Python\Python312\Lib\site-packages\js2py\utils\injector.py", line 27, in fix_js_args
    code = append_arguments(six.get_function_code(func), ('this', 'arguments'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Python312\Lib\site-packages\js2py\utils\injector.py", line 121, in append_arguments
    arg = name_translations[inst.arg]
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 3

Process finished with exit code 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions