py3: conditionalize cPickle import by adding in util
The cPickle is renamed to _pickle in python3 and this C extension is available in pickle which was not included in earlier versions. So imports are conditionalized to import cPickle in py2 and pickle in py3. Moreover the use of pickle in py2 is switched to cPickle as the C extension is faster. The hack is added in util.py and the modules import util.pickle
Showing
- hgext/convert/common.py 1 addition, 1 deletionhgext/convert/common.py
- hgext/convert/cvsps.py 2 additions, 1 deletionhgext/convert/cvsps.py
- hgext/convert/subversion.py 1 addition, 1 deletionhgext/convert/subversion.py
- hgext/histedit.py 1 addition, 1 deletionhgext/histedit.py
- mercurial/formatter.py 4 additions, 2 deletionsmercurial/formatter.py
- mercurial/pycompat.py 6 additions, 0 deletionsmercurial/pycompat.py
- mercurial/util.py 1 addition, 0 deletionsmercurial/util.py
- tests/test-check-py3-compat.t 5 additions, 6 deletionstests/test-check-py3-compat.t
Loading
Please register or sign in to comment