From 925061af4e3d35b8c06a43baa995e56a1b2663f5 2015-03-28 00:42:12 From: Min RK Date: 2015-03-28 00:42:12 Subject: [PATCH] move MAX_ITEMS, MAX_BYTES to session from serialize --- diff --git a/IPython/kernel/zmq/serialize.py b/IPython/kernel/zmq/serialize.py index 5ffa364..678e230 100644 --- a/IPython/kernel/zmq/serialize.py +++ b/IPython/kernel/zmq/serialize.py @@ -17,6 +17,8 @@ from IPython.utils.pickleutil import ( can, uncan, can_sequence, uncan_sequence, CannedObject, istype, sequence_types, PICKLE_PROTOCOL, ) +from .session import MAX_ITEMS, MAX_BYTES + if PY3: buffer = memoryview @@ -25,9 +27,6 @@ if PY3: # Serialization Functions #----------------------------------------------------------------------------- -# default values for the thresholds: -MAX_ITEMS = 64 -MAX_BYTES = 1024 def _extract_buffers(obj, threshold=MAX_BYTES): """extract buffers larger than a certain threshold""" diff --git a/jupyter_client/session.py b/jupyter_client/session.py index b830511..8727680 100644 --- a/jupyter_client/session.py +++ b/jupyter_client/session.py @@ -53,7 +53,6 @@ from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set, TraitError, ) from IPython.utils.pickleutil import PICKLE_PROTOCOL -from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES from jupyter_client.adapter import adapt #----------------------------------------------------------------------------- @@ -78,6 +77,10 @@ def squash_unicode(obj): # globals and defaults #----------------------------------------------------------------------------- +# default values for the thresholds: +MAX_ITEMS = 64 +MAX_BYTES = 1024 + # ISO8601-ify datetime objects # allow unicode # disallow nan, because it's not actually valid JSON