Skip to content

Commit 9769595

Browse files
wchschloerke
andauthored
Fixes for flake8 (#1012)
Co-authored-by: Barret Schloerke <[email protected]>
1 parent c625914 commit 9769595

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

shiny/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def _step(fut: Optional["asyncio.Future[None]"] = None):
393393
assert fut.done()
394394
try:
395395
fut.result()
396-
except BaseException as e:
396+
except BaseException as e: # noqa: B036
397397
exc = e
398398

399399
if result_future.cancelled():
@@ -419,7 +419,7 @@ def _step(fut: Optional["asyncio.Future[None]"] = None):
419419
except (KeyboardInterrupt, SystemExit) as e:
420420
result_future.set_exception(e)
421421
raise
422-
except BaseException as e:
422+
except BaseException as e: # noqa: B036
423423
result_future.set_exception(e)
424424
else:
425425
# If we get here, the coro didn't finish. Schedule it for completion.

shiny/render/renderer/_renderer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ class AsyncValueFn(Generic[IT]):
225225

226226
def __init__(self, fn: Callable[[], IT] | Callable[[], Awaitable[IT]]):
227227
if isinstance(fn, AsyncValueFn):
228-
return cast(AsyncValueFn[IT], fn)
228+
raise TypeError(
229+
"Must not call `AsyncValueFn.__init__` with an object of class `AsyncValueFn`"
230+
)
229231
self._is_async = is_async_callable(fn)
230232
self._fn = wrap_async(fn)
231233
self._orig_fn = fn

0 commit comments

Comments
 (0)