diff --git a/IPython/zmq/newserialized.py b/IPython/zmq/newserialized.py index 07577a7..a534d2c 100644 --- a/IPython/zmq/newserialized.py +++ b/IPython/zmq/newserialized.py @@ -119,7 +119,7 @@ class SerializeIt(object): elif self.typeDescriptor in ('bytes', 'buffer'): self.data = self.obj elif self.typeDescriptor == 'pickle': - self.data = pickle.dumps(self.obj, 2) + self.data = pickle.dumps(self.obj, -1) else: raise SerializationError("Really wierd serialization error.") del self.obj diff --git a/IPython/zmq/parallel/streamsession.py b/IPython/zmq/parallel/streamsession.py index c01e300..d98b5fe 100644 --- a/IPython/zmq/parallel/streamsession.py +++ b/IPython/zmq/parallel/streamsession.py @@ -160,7 +160,7 @@ def serialize_object(obj, threshold=64e-6): clist = canSequence(obj) slist = map(serialize, clist) for s in slist: - if s.getDataSize() > threshold: + if s.typeDescriptor in ('buffer', 'ndarray') or s.getDataSize() > threshold: databuffers.append(s.getData()) s.data = None return pickle.dumps(slist,-1), databuffers