kernel.pbutil

Module: kernel.pbutil

Utilities for PB using modules.

Functions

IPython.kernel.pbutil.checkMessageSize(m, info)

Check string m to see if it violates banana.SIZE_LIMIT.

This should be used on the client side of things for push, scatter and push_serialized and on the other end for pull, gather and pull_serialized.

Parameters:
m : string

Message whose size will be checked.

info : string

String describing what object the message refers to.

Exceptions:
  • PBMessageSizeError: Raised in the message is > banana.SIZE_LIMIT
Returns:

The original message or a Failure wrapping a PBMessageSizeError

IPython.kernel.pbutil.packageFailure(f)
Clean and pickle a failure preappending the string FAILURE:
IPython.kernel.pbutil.unpackageFailure(r)

See if a returned value is a pickled Failure object.

To distinguish between general pickled objects and pickled Failures, the other side should prepend the string FAILURE: to any pickled Failure.