add handler for JPython's org.python.core.PyStringMap object, which
walks and quacks like a dictionary.
This commit is contained in:
parent
f638d1c9dd
commit
2b9d029308
|
@ -38,6 +38,11 @@ mloads = marshal.loads
|
||||||
PicklingError = "pickle.PicklingError"
|
PicklingError = "pickle.PicklingError"
|
||||||
UnpicklingError = "pickle.UnpicklingError"
|
UnpicklingError = "pickle.UnpicklingError"
|
||||||
|
|
||||||
|
try:
|
||||||
|
from org.python.core import PyStringMap
|
||||||
|
except ImportError:
|
||||||
|
PyStringMap = None
|
||||||
|
|
||||||
MARK = '('
|
MARK = '('
|
||||||
STOP = '.'
|
STOP = '.'
|
||||||
POP = '0'
|
POP = '0'
|
||||||
|
@ -363,6 +368,8 @@ class Pickler:
|
||||||
write(SETITEMS)
|
write(SETITEMS)
|
||||||
|
|
||||||
dispatch[DictionaryType] = save_dict
|
dispatch[DictionaryType] = save_dict
|
||||||
|
if not PyStringMap is None:
|
||||||
|
dispatch[PyStringMap] = save_dict
|
||||||
|
|
||||||
def save_inst(self, object):
|
def save_inst(self, object):
|
||||||
d = id(object)
|
d = id(object)
|
||||||
|
|
Loading…
Reference in New Issue