"""This is a hack to pass the context around.
"""
# only exists in python 2.4+
try:
    from threading import local
except ImportError:
    # import copy of _thread_local.py from python 2.4
    from django.utils._threading_local import local
from mockup import mockup

_keeper = local()
_keeper.context = None

def set_context(context):
    _keeper.context = mockup(context)

def get_context():
    return _keeper.context
