naturalness / javac-parser

Exposes OpenJDK's Java parser and scanner to Python
https://pypi.org/project/javac-parser/
GNU Affero General Public License v3.0
6 stars 4 forks source link

javac-parser is broken with Python >= 3.10 #6

Open williamjallen opened 7 months ago

williamjallen commented 7 months ago

I get the following error when importing javac_parser with Python 3.10 and above:

Traceback (most recent call last):
  File ..., line 1, in </module><module>
    import javac_parser
  File "/usr/local/lib/python3.10/dist-packages/javac_parser/__init__.py", line 19, in </module><module>
    from .javac_parser import Java
  File "/usr/local/lib/python3.10/dist-packages/javac_parser/javac_parser.py", line 28, in </module><module>
    from py4j.java_gateway import JavaGateway, launch_gateway, GatewayParameters
  File "/usr/local/lib/python3.10/dist-packages/py4j/java_gateway.py", line 2336, in </module><module>
    __import__("py4j.java_collections")
  File "/usr/local/lib/python3.10/dist-packages/py4j/java_collections.py", line 13, in </module><module>
    from collections import (
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

This appears to be coming from your usage of py4j. Can you update py4j to get this working again?