Mercurial > hg-stable
changeset 50749:a2df74853f8d stable
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})
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 27 Jun 2023 10:09:11 +0200 |
parents | faccec1edc2c |
children | f173c2c23289 |
files | mercurial/util.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Tue Jun 27 13:51:50 2023 +0200 +++ b/mercurial/util.py Tue Jun 27 10:09:11 2023 +0200 @@ -1277,14 +1277,14 @@ >>> d1 = sortdict([(b'a', 0), (b'b', 1)]) >>> d2 = d1.copy() - >>> d2 - sortdict([('a', 0), ('b', 1)]) + >>> list(d2.items()) + [('a', 0), ('b', 1)] >>> d2.update([(b'a', 2)]) >>> list(d2.keys()) # should still be in last-set order ['b', 'a'] >>> d1.insert(1, b'a.5', 0.5) - >>> d1 - sortdict([('a', 0), ('a.5', 0.5), ('b', 1)]) + >>> list(d1.items()) + [('a', 0), ('a.5', 0.5), ('b', 1)] """ def __setitem__(self, key, value):