Skip to content

Commit 9e00ab2

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent e94c14a commit 9e00ab2

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

src/werkzeug/_internal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def _wsgi_encoding_dance(s: str) -> str:
3636

3737
def _get_environ(obj: WSGIEnvironment | Request) -> WSGIEnvironment:
3838
env = getattr(obj, "environ", obj)
39-
assert isinstance(
40-
env, dict
41-
), f"{type(obj).__name__!r} is not a WSGI environment (has to be a dict)"
39+
assert isinstance(env, dict), (
40+
f"{type(obj).__name__!r} is not a WSGI environment (has to be a dict)"
41+
)
4242
return env
4343

4444

src/werkzeug/debug/tbtools.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ def all_tracebacks(
249249
chained_exc = current.__cause__
250250
elif current.__context__ is not None and not current.__suppress_context__:
251251
chained_msg = (
252-
"During handling of the above exception, another"
253-
" exception occurred"
252+
"During handling of the above exception, another exception occurred"
254253
)
255254
chained_exc = current.__context__
256255
else:
@@ -410,7 +409,7 @@ def render_line(line: str, cls: str) -> None:
410409
if cls == "current" and colno and end_colno:
411410
arrow = (
412411
f'\n<span class="ws">{" " * prefix}</span>'
413-
f'{" " * (colno - prefix)}{"^" * (end_colno - colno)}'
412+
f"{' ' * (colno - prefix)}{'^' * (end_colno - colno)}"
414413
)
415414
else:
416415
arrow = ""

src/werkzeug/exceptions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ class BadRequest(HTTPException):
181181

182182
code = 400
183183
description = (
184-
"The browser (or proxy) sent a request that this server could "
185-
"not understand."
184+
"The browser (or proxy) sent a request that this server could not understand."
186185
)
187186

188187

@@ -208,10 +207,7 @@ def __init__(self, arg: object | None = None, *args: t.Any, **kwargs: t.Any):
208207
@property # type: ignore
209208
def description(self) -> str:
210209
if self.show_exception:
211-
return (
212-
f"{self._description}\n"
213-
f"{KeyError.__name__}: {KeyError.__str__(self)}"
214-
)
210+
return f"{self._description}\n{KeyError.__name__}: {KeyError.__str__(self)}"
215211

216212
return self._description
217213

src/werkzeug/routing/rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def parse_converter_args(argstr: str) -> tuple[tuple[t.Any, ...], dict[str, t.An
118118
for item in _converter_args_re.finditer(argstr):
119119
if item.start() != position:
120120
raise ValueError(
121-
f"Cannot parse converter argument '{argstr[position:item.start()]}'"
121+
f"Cannot parse converter argument '{argstr[position : item.start()]}'"
122122
)
123123

124124
value = item.group("stringval")

tests/test_debug.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ def __repr__(self):
156156
raise Exception("broken!")
157157

158158
assert debug_repr(Foo()) == (
159-
'<span class="brokenrepr">&lt;broken repr (Exception: '
160-
"broken!)&gt;</span>"
159+
'<span class="brokenrepr">&lt;broken repr (Exception: broken!)&gt;</span>'
161160
)
162161

163162

0 commit comments

Comments
 (0)