Files
manual_slop/thirdparty/defer/errors.py
T

14 lines
333 B
Python

from types import FunctionType
class DeferErrror(RuntimeError):
pass
class FreeVarsError(DeferErrror):
def __init__(self, fn: FunctionType) -> None:
super().__init__(
"deferred function must not have free variables",
)
self.add_note("free vars: " + str(list(fn.__code__.co_freevars)))