grantjenks / py-tree-sitter-languages

Binary Python wheels for all tree sitter languages.
Other
114 stars 35 forks source link

error when calling get_language('any_language') #64

Open mohmehdi opened 1 month ago

mohmehdi commented 1 month ago

tree-sitter has updated the Language class and how they initialize it so now it takes just one parameter. here: example usage

scanny commented 1 month ago

Quick-fix is to downgrade to treesitter==0.21.3:

$ pip install -U tree-sitter==0.21.3

In my particular case that results in an unwelcome warning being emitted to the console at runtime:

.../python3.11/site-packages/tree_sitter/__init__.py:36: FutureWarning: Language(path, name) is deprecated. Use Language(ptr, name) instead.

but that is easily avoided in my case using the python -Wignore ... command-line flag.