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

[pull] main from pallets:main #286

Merged
merged 3 commits into from
May 12, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
fail-fast: false
matrix:
include:
- {python: '3.13'}
- {python: '3.12'}
- {name: Windows, python: '3.12', os: windows-latest}
- {name: Mac, python: '3.12', os: macos-latest}
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ strict = true
module = [
"colorama.*",
"cryptography.*",
"eventlet.*",
"gevent.*",
"greenlet.*",
"watchdog.*",
"xprocess.*",
]
Expand Down
4 changes: 1 addition & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ certifi==2024.2.2
# via
# -r docs.txt
# requests
cffi==1.16.0
cffi @ https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
# via
# -r tests.txt
# cryptography
Expand Down Expand Up @@ -46,8 +46,6 @@ filelock==3.13.3
# via
# tox
# virtualenv
greenlet==3.0.3
# via -r tests.txt
identify==2.5.35
# via pre-commit
idna==3.6
Expand Down
3 changes: 2 additions & 1 deletion requirements/tests.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pytest-timeout
# pinned for python 3.8 support
pytest-xprocess<1
cryptography
greenlet
watchdog
ephemeral-port-reserve
# pin current commit on main for python 3.13 support
https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
8 changes: 4 additions & 4 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#
# pip-compile tests.in
#
cffi==1.16.0
# via cryptography
cffi @ https://github.com/python-cffi/cffi/archive/d7f750b1b1c5ea4da5aa537b9baba0e01b0ce843.zip
# via
# -r tests.in
# cryptography
cryptography==42.0.5
# via -r tests.in
ephemeral-port-reserve==1.1.4
# via -r tests.in
greenlet==3.0.3
# via -r tests.in
iniconfig==2.0.0
# via pytest
packaging==24.0
Expand Down
15 changes: 13 additions & 2 deletions src/werkzeug/debug/tbtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ def render_traceback_html(self, include_title: bool = True) -> str:

rows.append("\n".join(row_parts))

is_syntax_error = issubclass(self._te.exc_type, SyntaxError)
if sys.version_info < (3, 13):
exc_type_str = self._te.exc_type.__name__
else:
exc_type_str = self._te.exc_type_str

is_syntax_error = exc_type_str == "SyntaxError"

if include_title:
if is_syntax_error:
Expand Down Expand Up @@ -325,13 +330,19 @@ def render_debugger_html(
) -> str:
exc_lines = list(self._te.format_exception_only())
plaintext = "".join(self._te.format())

if sys.version_info < (3, 13):
exc_type_str = self._te.exc_type.__name__
else:
exc_type_str = self._te.exc_type_str

return PAGE_HTML % {
"evalex": "true" if evalex else "false",
"evalex_trusted": "true" if evalex_trusted else "false",
"console": "false",
"title": escape(exc_lines[0]),
"exception": escape("".join(exc_lines)),
"exception_type": escape(self._te.exc_type.__name__),
"exception_type": escape(exc_type_str),
"summary": self.render_traceback_html(include_title=False),
"plaintext": escape(plaintext),
"plaintext_cs": re.sub("-{2,}", "-", plaintext),
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{13,12,11,10,9,8}
pypy310
style
typing
Expand Down
Loading