Re: pyxdg-0.28 fails tests with python-3.12
"Andrey G. Grozin" <[email protected]> Sat, 28 Oct 2023 23:01:19 +0700 (+07)
| Newsgroups | gmane.linux.xdg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 28 Oct 2023, Andrey G. Grozin wrote:
> The problem becomes clear. test_basedirectory.py contains the line
>
> from imp import reload
>
> with python3.11, it generates a deprecation warning: the module imp is
> deprecated, and will be removed in python3.12. Now in python3.12 it *has*
> been removed. And, instead of a warning, we get a fatal error.
Simply replacing
from imp import reload
by
from importlib import reload
solves the problem. Now the tests pass successfully. But 5 new deprecation
warnings are produced:
DeprecationWarning: ast.Str is deprecated and will be removed in Python
3.14; use ast.Constant instead
Probably, it would be better not to wait until things will break again (in
python3.14), but to fix this new problem now.
Andrey