From 40afc6ceecbf99a6b7effc310cc2f319f400da35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 15 Aug 2022 21:19:01 +0200 Subject: [PATCH] fix one typo and two pycodestyle suggestions --- docs/extensiondev.rst | 2 +- src/flask/cli.py | 2 +- src/flask/config.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index 95745119..7b54917d 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -184,7 +184,7 @@ context is active when a request context is, or when a CLI command is run. If you're storing something that should be closed, use :meth:`~flask.Flask.teardown_appcontext` to ensure that it gets closed when the application context ends. If it should only be valid during a -request, or would not be used in the CLI outside a reqeust, use +request, or would not be used in the CLI outside a request, use :meth:`~flask.Flask.teardown_request`. diff --git a/src/flask/cli.py b/src/flask/cli.py index 82fe8194..574264dc 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -648,7 +648,7 @@ def _path_is_ancestor(path, other): """Take ``other`` and remove the length of ``path`` from it. Then join it to ``path``. If it is the original value, ``path`` is an ancestor of ``other``.""" - return os.path.join(path, other[len(path) :].lstrip(os.sep)) == other + return os.path.join(path, other[len(path):].lstrip(os.sep)) == other def load_dotenv(path: str | os.PathLike | None = None) -> bool: diff --git a/src/flask/config.py b/src/flask/config.py index 7b6a137a..802c88ef 100644 --- a/src/flask/config.py +++ b/src/flask/config.py @@ -325,7 +325,7 @@ class Config(dict): if not k.startswith(namespace): continue if trim_namespace: - key = k[len(namespace) :] + key = k[len(namespace):] else: key = k if lowercase: