Skip to content

Commit

Permalink
Fixes for flake8 (#1012)
Browse files Browse the repository at this point in the history
Co-authored-by: Barret Schloerke <[email protected]>
  • Loading branch information
wch and schloerke authored Jan 16, 2024
1 parent c625914 commit 9769595
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shiny/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _step(fut: Optional["asyncio.Future[None]"] = None):
assert fut.done()
try:
fut.result()
except BaseException as e:
except BaseException as e: # noqa: B036
exc = e

if result_future.cancelled():
Expand All @@ -419,7 +419,7 @@ def _step(fut: Optional["asyncio.Future[None]"] = None):
except (KeyboardInterrupt, SystemExit) as e:
result_future.set_exception(e)
raise
except BaseException as e:
except BaseException as e: # noqa: B036
result_future.set_exception(e)
else:
# If we get here, the coro didn't finish. Schedule it for completion.
Expand Down
4 changes: 3 additions & 1 deletion shiny/render/renderer/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ class AsyncValueFn(Generic[IT]):

def __init__(self, fn: Callable[[], IT] | Callable[[], Awaitable[IT]]):
if isinstance(fn, AsyncValueFn):
return cast(AsyncValueFn[IT], fn)
raise TypeError(
"Must not call `AsyncValueFn.__init__` with an object of class `AsyncValueFn`"
)
self._is_async = is_async_callable(fn)
self._fn = wrap_async(fn)
self._orig_fn = fn
Expand Down

0 comments on commit 9769595

Please sign in to comment.