Mercurial > hg
diff hgext/convert/subversion.py @ 29324:b501579147f1
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 04 Jun 2016 14:38:00 +0530 |
parents | a0939666b836 |
children | 72f75eda02ba |
line wrap: on
line diff
--- a/hgext/convert/subversion.py Fri Jun 03 21:49:26 2016 +0900 +++ b/hgext/convert/subversion.py Sat Jun 04 14:38:00 2016 +0530 @@ -3,7 +3,6 @@ # Copyright(C) 2007 Daniel Holth et al from __future__ import absolute_import -import cPickle as pickle import os import re import sys @@ -21,6 +20,7 @@ from . import common +pickle = util.pickle stringio = util.stringio propertycache = util.propertycache urlerr = util.urlerr