Mercurial > hg
comparison mercurial/util.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 | 82f6193ff2bc |
children | c27dc3c31222 |
comparison
equal
deleted
inserted
replaced
29321:de4a80a2b45c | 29324:b501579147f1 |
---|---|
45 pycompat, | 45 pycompat, |
46 ) | 46 ) |
47 | 47 |
48 for attr in ( | 48 for attr in ( |
49 'empty', | 49 'empty', |
50 'pickle', | |
50 'queue', | 51 'queue', |
51 'urlerr', | 52 'urlerr', |
52 # we do import urlreq, but we do it outside the loop | 53 # we do import urlreq, but we do it outside the loop |
53 #'urlreq', | 54 #'urlreq', |
54 'stringio', | 55 'stringio', |