otsaloma / gaupol

Editor for text-based subtitle files
https://otsaloma.io/gaupol/
GNU General Public License v3.0
247 stars 35 forks source link

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

Closed musicinmybrain closed 1 year ago

musicinmybrain commented 1 year ago

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.

otsaloma commented 1 year ago

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 commented 1 year ago

Sure, I’m even happier with that approach.

musicinmybrain commented 1 year ago

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

otsaloma commented 1 year ago

Thanks!