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

Use importlib.reload instead of imp.reload (Python 3.12 compat) #211

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

musicinmybrain
Copy link
Contributor

In aeidon/test/test_locales.py, use importlib.reload where available (Python 3.4 and later) instead of imp.reload; the imp module has been deprecated since Python 3.4 and is removed in Python 3.12, so this is a Python 3.12 compatibility fix.

The fallback to imp.reload is preserved since README.md claims support for Python 3.2.

In aeidon/test/test_locales.py, use importlib.reload where available
(Python 3.4 and later) instead of imp.reload; the imp module has been
deprecated since Python 3.4 and is removed in Python 3.12, so this is a
Python 3.12 compatibility fix.
@otsaloma
Copy link
Owner

Thanks, I had not noticed this.

Could you please change it so it uses importlib.reload only and update the Python requirement in the README too. I don't in general like cluttering code with these version-specific branches and in this case I doubt the README is correct anymore. I have most likely already broken Python 3.2 compatibility unknowingly at some point and by now that should be fine.

@musicinmybrain
Copy link
Contributor Author

Sure, I’m even happier with that approach.

@musicinmybrain
Copy link
Contributor Author

I’ve updated the PR to disclaim Python 3.2 and Python 3.3 support.

@musicinmybrain musicinmybrain changed the title Prefer importlib.reload to imp.reload Use importlib.reload instead of imp.reload (Python 3.12 compat) Jun 28, 2023
@otsaloma
Copy link
Owner

Thanks!

@otsaloma otsaloma merged commit 9c9522c into otsaloma:master Jun 28, 2023
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.

2 participants