Source

dogpile.cache / dogpile / compat.py

Full commit
import sys


py3k = sys.version_info >= (3, 0)
jython = sys.platform.startswith('java')


if py3k: # pragma: no cover
    string_types = str,
    text_type = str

    import configparser
    import io
else:
    string_types = basestring,
    text_type = unicode

    import ConfigParser as configparser
    import StringIO as io

if py3k or jython:
    import pickle
else:
    import cPickle as pickle