MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / inner

Function inner

pywebio/session/__init__.py:250–262  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

248
249 @wraps(func)
250 def inner(*args, **kwargs):
251 curr_impl = get_session_implement()
252
253 # Check if 'now_impl' is a derived from session_type or is the same class
254 if not issubclass(curr_impl, session_type):
255 func_name = getattr(func, '__name__', str(func))
256 require = getattr(session_type, '__name__', str(session_type))
257 curr = getattr(curr_impl, '__name__', str(curr_impl))
258
259 raise RuntimeError("Only can invoke `{func_name:s}` in {require:s} context."
260 " You are now in {curr:s} context".format(func_name=func_name, require=require,
261 curr=curr))
262 return func(*args, **kwargs)
263
264 return inner
265

Callers

nothing calls this directly

Calls 3

get_session_implementFunction · 0.85
to_coroutineFunction · 0.85
run_as_functionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…