manually adapt few imports

This commit is contained in:
ilvalle
2016-06-01 20:16:30 +02:00
parent aa2bf4134e
commit 01bab81432
28 changed files with 174 additions and 189 deletions
+6 -9
View File
@@ -12,11 +12,7 @@ Provides:
- Storage; like dictionary allowing also for `obj.foo` for `obj['foo']`
"""
try:
import cPickle as pickle
except:
import pickle
import copy_reg
from gluon._compat import copyreg, pickle, PY2
import gluon.portalocker as portalocker
__all__ = ['List', 'Storage', 'Settings', 'Messages',
@@ -139,10 +135,11 @@ class Storage(dict):
def pickle_storage(s):
return Storage, (dict(s),)
copy_reg.pickle(Storage, pickle_storage)
PICKABLE = (str, int, long, float, bool, list, dict, tuple, set)
copyreg.pickle(Storage, pickle_storage)
if PY2:
PICKABLE = (str, int, long, float, bool, list, dict, tuple, set)
else:
PICKABLE = (str, int, float, bool, list, dict, tuple, set)
class StorageList(Storage):
"""