Commit 6463b9be authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py3: use py2 compatible pickle protocol in testXMLPickle.

parent 35dd2fe2
......@@ -31,6 +31,7 @@ import pickle
import re
import xml.sax
from six.moves import cStringIO as StringIO
from io import BytesIO
from Products.ERP5Type.XMLExportImport import ppml
......@@ -58,8 +59,8 @@ class TestXMLPickle(unittest.TestCase):
pattern = re.compile('WAA') # regex pattern object uses reduce.(See sre.py)
obj.data.append(pattern)
pickled_string = pickle.dumps(obj)
f = StringIO(pickled_string)
pickled_string = pickle.dumps(obj, protocol=2)
f = BytesIO(pickled_string)
xmldata = str(ppml.ToXMLUnpickler(f).load())
output = StringIO()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment