Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sanic/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def _inspector(self):
key, value = arg.split("=")
key = key.lstrip("-")
except ValueError:
value = False if arg.startswith("--no-") else True
value = not arg.startswith("--no-")
key = (
arg.replace("--no-", "")
.lstrip("-")
Expand Down
2 changes: 1 addition & 1 deletion sanic/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def stat_async(path) -> Awaitable[os.stat_result]:
return trio.Path(path).stat()

open_async = trio.open_file
CancelledErrors = tuple([asyncio.CancelledError, trio.Cancelled])
CancelledErrors = (asyncio.CancelledError, trio.Cancelled)
else:
if PYPY_IMPLEMENTATION:
pypy_os_module_patch()
Expand Down
2 changes: 1 addition & 1 deletion sanic/server/websockets/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ def connection_lost(self, exc):
"""
The WebSocket Connection is Closed.
"""
if not self.ws_proto.state == CLOSED:
if self.ws_proto.state != CLOSED:
# signal to the websocket connection handler
# we've lost the connection
self.ws_proto.fail(code=1006)
Expand Down
6 changes: 2 additions & 4 deletions sanic/worker/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@ def _wait_to_terminate(self):

def _add_config(self) -> bool:
sig = signature(self.target)
if "config" in sig.parameters or any(
return "config" in sig.parameters or any(
param.kind == param.VAR_KEYWORD
for param in sig.parameters.values()
):
return True
return False
)


class Worker:
Expand Down
Loading