mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
util: banish pickle to compathacks
This commit is contained in:
parent
b25303f2f1
commit
d69f23e5a5
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user