Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added minor type hinting #3024

Merged
merged 2 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions sanic/cli/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ def attach(self):
dest="auto_reload",
action="store_true",
help=(
"Watch source directory for file changes and reload on "
"changes"
"Watch source directory for file changes and reload on changes"
),
)
self.container.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion sanic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def load_environment_vars(self, prefix=SANIC_PREFIX):
except ValueError:
pass

def update_config(self, config: Union[bytes, str, dict, Any]):
def update_config(self, config: Union[bytes, str, dict[str, Any], Any]):
"""Update app.config.

.. note::
Expand Down
2 changes: 1 addition & 1 deletion sanic/handlers/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def response(self, request, exception):
except AttributeError: # no cov
url = "unknown"
response_message = (
"Exception raised in exception handler " '"%s" for uri: %s'
'Exception raised in exception handler "%s" for uri: %s'
)
error_logger.exception(response_message, handler.__name__, url)

Expand Down
2 changes: 1 addition & 1 deletion sanic/logging/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _color_exception_line(self, line: str) -> str: # no cov
return line
exc = match.group("exc")
message = match.group("message")
return f"{c.SANIC}{c.BOLD}{exc}{c.END}: " f"{c.BOLD}{message}{c.END}"
return f"{c.SANIC}{c.BOLD}{exc}{c.END}: {c.BOLD}{message}{c.END}"

def _color_file_line(self, line: str) -> str: # no cov
match = FILE_LINE_RE.search(line)
Expand Down
2 changes: 1 addition & 1 deletion sanic/mixins/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def get_server_location(
if server_settings.get("ssl") is not None:
proto = "https"
if server_settings.get("unix"):
serve_location = f'{server_settings["unix"]} {proto}://...'
serve_location = f"{server_settings['unix']} {proto}://..."
elif server_settings.get("sock"):
host, port, *_ = server_settings["sock"].getsockname()

Expand Down
2 changes: 1 addition & 1 deletion sanic/response/convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async def validate_file(
if_modified_since = parsedate_to_datetime(if_modified_since)
except (TypeError, ValueError):
logger.warning(
"Ignorning invalid If-Modified-Since header received: " "'%s'",
"Ignorning invalid If-Modified-Since header received: '%s'",
if_modified_since,
)
return None
Expand Down
Loading