def _set_default_thread_stacklevel(stacklevel): from mpx._python.thread import get_ident ident = get_ident() if stacklevel is None: if _default_thread_stacklevel.has_key(ident): del _default_thread_stacklevel[ident] else: _default_thread_stacklevel[ident] = stacklevel return
def deprecated(message, stacklevel=None): if stacklevel is None: from mpx._python.thread import get_ident ident = get_ident() if _default_thread_stacklevel.has_key(ident): stacklevel = _default_thread_stacklevel[ident] else: stacklevel = 3 _warnings.warn(message, DeprecationWarning, stacklevel) return