import warnings
import pickle


def cpickle_load(filename):
    """Load object written by ``cPickle.dump()``. Deprecated, use
    :func:`~pwtools.io.read_pickle` instead."""
    warnings.warn("cpickle_load() is deprcated, use io.read_pickle() instead",
                   DeprecationWarning)
    return pickle.load(open(filename, 'rb'))