util: banish pickle to compathacks

This commit is contained in:
Sean Farley 2014-02-15 01:58:07 -06:00
parent b25303f2f1
commit d69f23e5a5
2 changed files with 7 additions and 3 deletions

View File

@ -10,3 +10,8 @@ def branchset(repo):
return set(repo.branchmap())
except AttributeError:
return set(repo.branchtags())
def pickle_load(f):
import cPickle as pickle
f.seek(0)
return pickle.load(f)

View File

@ -1,4 +1,4 @@
import cPickle as pickle
import compathacks
import errno
import re
import os
@ -192,8 +192,7 @@ def load(file_path):
f.close()
except ValueError:
# Ok, JSON couldn't be loaded, so we'll try the old way of using pickle
f.seek(0)
data = pickle.load(f)
data = compathacks.pickle_load(f)
# convert the file to json immediately
f.close()