mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-22 19:53:00 -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:
|
if not sig.parameters:
|
||||||
# Function is async: must be awaited
|
# Function is async: must be awaited
|
||||||
if inspect.iscoroutinefunction(func):
|
if inspect.iscoroutinefunction(func):
|
||||||
|
|
||||||
async def wrapper(*args, **kwargs):
|
async def wrapper(*args, **kwargs):
|
||||||
await func()
|
await func()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
func()
|
func()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
wrapper = func
|
wrapper = func
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user