Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shim for deprecated/removed ElementTree.getiterator(tag) #17

Merged
merged 1 commit into from Aug 13, 2021

Conversation

reinhart1010
Copy link
Contributor

Fixes #16.

Instead of bumping up the Python version requirement for Typecatcher to work I made a shim which calls the good old ElementTree.getiterator(tag) for Python 3.1 and below, and instead use the new ElementTree.iter(tag) for newer versions of Python (introduced since 3.2). The former method has been removed starting from Python 3.9.

I can't build through setup.py due to issues with my build environment (unable to import DistUtilsExtra.auto despite having python3-apt installed on Ubuntu 21.04). However, I've tested it with both tests/test_pyflake.py and tests/unit_tests.py and finally run the program through python3 bin/typecatcher.

image

Copy link
Owner

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for the fix!

@andrewsomething andrewsomething merged commit a0b9be2 into andrewsomething:master Aug 13, 2021
@andrewsomething
Copy link
Owner

due to issues with my build environment (unable to import DistUtilsExtra.auto despite having python3-apt installed on Ubuntu 21.04).

Do you have python3-distutils-extra installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typecatcher fails to run on Python 3.9 due to deprecated method
2 participants