Managing thirdparty package: defer.
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
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)))
|
||||
Reference in New Issue
Block a user