def supports_caller(func):
 def wrap_stackframe(context, *args, **kwargs):
  context.caller_stack._push_frame()
  try:
   return func(context, *args, **kwargs)
  finally:
   context.caller_stack._pop_frame()
 return wrap_stackframe

def supports_caller ( func ) : def wrap_stackframe ( context , * args , ** kwargs ) : context . caller_stack . _push_frame ( ) try : return func ( context , * args , ** kwargs ) finally : context . caller_stack . _pop_frame ( ) return wrap_stackframe
apply a caller_stack compatibility decorator to a plain python function .