def _not_reentrant(func):
    """Decorator that prevents callbacks from calling into link methods that
    are not reentrant """
    def wrap(*args, **kws):
        link = args[0]
        if link._callback_lock.in_callback:
            m = "Link %s cannot be invoked from a callback!" % func
            raise RuntimeError(m)
        return func(*args, **kws)
    return wrap
def _not_reentrant ( func ) : def wrap ( * args , ** kws ) : link = args [ 0 ] if link . _callback_lock . in_callback : m = "Link %s cannot be invoked from a callback!" % func raise RuntimeError ( m ) return func ( * args , ** kws ) return wrap
Decorator that prevents callbacks from calling into link methods that
    are not reentrant