mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -68,11 +68,15 @@ def when(target, *args, **kwargs):
|
||||
if not sig.parameters:
|
||||
# Function is async: must be awaited
|
||||
if inspect.iscoroutinefunction(func):
|
||||
|
||||
async def wrapper(*args, **kwargs):
|
||||
await func()
|
||||
|
||||
else:
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
func()
|
||||
|
||||
else:
|
||||
wrapper = func
|
||||
except AttributeError:
|
||||
|
||||
@@ -242,7 +242,7 @@ def test_when_decorates_a_whenable():
|
||||
"args": self.args,
|
||||
"kwargs": self.kwargs,
|
||||
}
|
||||
self.handler(result) # call the handler
|
||||
self.handler(result) # call the handler
|
||||
|
||||
def __when__(self, handler, *args, **kwargs):
|
||||
"""
|
||||
@@ -305,7 +305,7 @@ def test_when_called_with_a_whenable():
|
||||
"args": self.args,
|
||||
"kwargs": self.kwargs,
|
||||
}
|
||||
self.handler(result) # call the handler
|
||||
self.handler(result) # call the handler
|
||||
|
||||
def __when__(self, handler, *args, **kwargs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user