Mercurial > hg
comparison hgext/histedit.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 | ceca932c080d |
children | 00d2bf4137e6 |
comparison
equal
deleted
inserted
replaced
29321:de4a80a2b45c | 29324:b501579147f1 |
---|---|
171 | 171 |
172 from __future__ import absolute_import | 172 from __future__ import absolute_import |
173 | 173 |
174 import errno | 174 import errno |
175 import os | 175 import os |
176 import pickle | |
177 import sys | 176 import sys |
178 | 177 |
179 from mercurial.i18n import _ | 178 from mercurial.i18n import _ |
180 from mercurial import ( | 179 from mercurial import ( |
181 bundle2, | 180 bundle2, |
195 repair, | 194 repair, |
196 scmutil, | 195 scmutil, |
197 util, | 196 util, |
198 ) | 197 ) |
199 | 198 |
199 pickle = util.pickle | |
200 release = lock.release | 200 release = lock.release |
201 cmdtable = {} | 201 cmdtable = {} |
202 command = cmdutil.command(cmdtable) | 202 command = cmdutil.command(cmdtable) |
203 | 203 |
204 class _constraints(object): | 204 class _constraints(object): |