Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 48870:df56e6bd37f6
py3: use pickle directly
pycompat.pickle abstracted over the different pickle modules in
Python 2 and 3. Now that we're Python 3 only, it is safe to use the
`pickle` module directly. So this commit does that.
As part of this we remove the rules from check-code.py that were
forbidden direct pickle module use.
We retain the `util.pickle` symbol for backwards compatibility, just
in case some extensions were using it.
Differential Revision: https://phab.mercurial-scm.org/D12249
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 01 Mar 2022 20:29:03 -0800 |
parents | 75fc2537d93c |
children | 5aafc3c5bdec |
comparison
equal
deleted
inserted
replaced
48869:57b58413dad1 | 48870:df56e6bd37f6 |
---|---|
74 b85decode = base85.b85decode | 74 b85decode = base85.b85decode |
75 b85encode = base85.b85encode | 75 b85encode = base85.b85encode |
76 | 76 |
77 cookielib = pycompat.cookielib | 77 cookielib = pycompat.cookielib |
78 httplib = pycompat.httplib | 78 httplib = pycompat.httplib |
79 pickle = pycompat.pickle | |
80 safehasattr = pycompat.safehasattr | 79 safehasattr = pycompat.safehasattr |
81 socketserver = pycompat.socketserver | 80 socketserver = pycompat.socketserver |
82 bytesio = pycompat.bytesio | 81 bytesio = pycompat.bytesio |
83 # TODO deprecate stringio name, as it is a lie on Python 3. | 82 # TODO deprecate stringio name, as it is a lie on Python 3. |
84 stringio = bytesio | 83 stringio = bytesio |