Skip to content

Commit 8574bd5

Browse files
committed
[FIX] fastapi_backport: Protect against inner_exception attribute error
1 parent 4d84ebd commit 8574bd5

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.pre-commit-config.yaml

+13-15
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exclude: |
1616
(LICENSE.*|COPYING.*)
1717
default_language_version:
1818
python: python3
19-
node: "14.13.0"
19+
node: "18.18.2"
2020
repos:
2121
- repo: local
2222
hooks:
@@ -33,14 +33,14 @@ repos:
3333
language: fail
3434
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
3535
- repo: https://github.com/oca/maintainer-tools
36-
rev: ab1d7f6
36+
rev: 451de41fa3e8aa81d077c804322d48632eb5ff74
3737
hooks:
3838
# update the NOT INSTALLABLE ADDONS section above
3939
- id: oca-update-pre-commit-excluded-addons
4040
- id: oca-fix-manifest-website
4141
args: ["https://github.com/akretion/ak-odoo-incubator"]
4242
- repo: https://github.com/myint/autoflake
43-
rev: v1.4
43+
rev: v2.3.1
4444
hooks:
4545
- id: autoflake
4646
args:
@@ -51,22 +51,20 @@ repos:
5151
- --remove-duplicate-keys
5252
- --remove-unused-variables
5353
- repo: https://github.com/psf/black
54-
rev: 22.3.0
54+
rev: 24.2.0
5555
hooks:
5656
- id: black
5757
- repo: https://github.com/pre-commit/mirrors-prettier
58-
rev: v2.1.2
58+
rev: v3.1.0
5959
hooks:
6060
- id: prettier
61-
name: prettier (with plugin-xml)
61+
name: prettier + plugin-xml
6262
additional_dependencies:
63-
- "prettier@2.1.2"
64-
- "@prettier/plugin-xml@0.12.0"
65-
args:
66-
- --plugin=@prettier/plugin-xml
63+
- "prettier@3.1.0"
64+
- "@prettier/plugin-xml@3.3.1"
6765
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
6866
- repo: https://github.com/pre-commit/mirrors-eslint
69-
rev: v7.8.1
67+
rev: v8.56.0
7068
hooks:
7169
- id: eslint
7270
verbose: true
@@ -101,7 +99,7 @@ repos:
10199
- id: pyupgrade
102100
args: ["--keep-percent-format"]
103101
- repo: https://github.com/PyCQA/isort
104-
rev: 5.12.0
102+
rev: 5.13.2
105103
hooks:
106104
- id: isort
107105
name: isort except __init__.py
@@ -119,13 +117,13 @@ repos:
119117
- --header
120118
- "# generated from manifests external_dependencies"
121119
- repo: https://github.com/PyCQA/flake8
122-
rev: 3.8.3
120+
rev: 7.0.0
123121
hooks:
124122
- id: flake8
125123
name: flake8
126-
additional_dependencies: ["flake8-bugbear==20.1.4"]
124+
additional_dependencies: ["flake8-bugbear==24.2.6"]
127125
- repo: https://github.com/OCA/pylint-odoo
128-
rev: 7.0.2
126+
rev: v9.0.5
129127
hooks:
130128
- id: pylint_odoo
131129
name: pylint with optional checks

fastapi_backport/http.py

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def __init__(self, *args):
4242
super().__init__(*args)
4343
self.params = {}
4444
self._dispatcher = http._dispatchers.get("fastapi", FastApiDispatcher)(self)
45+
# Ensure inner_exception exists on dispatcher since the flow on error
46+
# is quite different
47+
self._dispatcher.inner_exception = None
4548

4649
def make_response(self, data, headers=None, cookies=None, status=200):
4750
"""Helper for non-HTML responses, or HTML responses with custom

0 commit comments

Comments
 (0)