Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 17:21:14 +0100] rev 50759
configitems: use standard "dynamicdefault" approach in edge case
This makes for fewer edge cases, which will help a future patch.
Raphaël Gomès <rgomes@octobus.net> [Tue, 17 Jan 2023 14:53:18 +0100] rev 50758
configitems: fix typo in devel warning about extension overrides
Mads Kiilerich <mads@kiilerich.com> [Wed, 28 Jun 2023 14:23:13 +0200] rev 50757
extensions: imp module is removed in Python 3.12 - use importlib to load files
imp has been deprecated for a long time, and has finally been removed in Python
3.12 .
imp was only used for loading extensions that has been specified with direct
.py path or path to a package directory. The same use cases can be achieved
quite simple with importlib, , possiby with small changes in corner cases with
undefined behaviour, such as extensions without .py source.
There might also be corner cases and undefined behaviour around use of
sys.modules and reloading.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:05:03 +0200] rev 50756
utils: imp module is removed in Python 3.12 - get is_frozen() from _imp
imp has been deprecated for a long time, and has finally been removed in Python
3.12 .
The successor importlib is using the same internal _imp module as imp, but
doesn't expose it's is_frozen. Using the internal function directly seems like
the cleanest solution.
Another alternative to
imp.is_frozen("__main__")
is
sys.modules['__main__'].__spec__.origin == 'frozen'
but that seems even more internal and fragile.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 22:31:44 +0200] rev 50755
extensions: address ast deprecations introduced in Python 3.12
Tests would fail with:
.../mercurial/extensions.py:910: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
if isinstance(a, ast.Str):
.../mercurial/extensions.py:912: DeprecationWarning: ast.Bytes is deprecated and will be removed in Python 3.14; use ast.Constant instead
elif isinstance(a, ast.Bytes):
.../mercurial/extensions.py:913: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
name = a.s
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 08:39:12 +0200] rev 50754
vfs: handle shutil.rmtree deprecation of onerror in Python 3.12
Tests would fail with warnings:
.../mercurial/vfs.py:289: DeprecationWarning: onerror argument is deprecated, use onexc instead
The excinfo changed slightly, but we don't use it anyway.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 10:09:11 +0200] rev 50753
tests: fix sortdict doctest with Python 3.12
The output of OrderedDict changed to use plain dict syntax:
$ python3.11 -c "import collections;print(collections.OrderedDict([('a', 0), ('b', 1)]))"
OrderedDict([('a', 0), ('b', 1)])
$ python3.12 -c "import collections;print(collections.OrderedDict([('a', 0), ('b', 1)]))"
OrderedDict({'a': 0, 'b': 1})