mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-18 05:32:03 +02:00
fix: werkzeug version detection for 2.1.0+
Werkzeug 2.1.0+ removed __version__ attribute.
Use importlib.metadata as fallback for version detection.
🤖 assisted by claude
This commit is contained in:
parent
a6177fc077
commit
450d654f95
1 changed files with 7 additions and 1 deletions
|
|
@ -255,7 +255,13 @@ ROUTING_KEYS = {
|
|||
'alias', 'host', 'methods',
|
||||
}
|
||||
|
||||
if parse_version(werkzeug.__version__) >= parse_version('2.0.2'):
|
||||
try:
|
||||
_werkzeug_version = werkzeug.__version__
|
||||
except AttributeError:
|
||||
from importlib.metadata import version as _get_version
|
||||
_werkzeug_version = _get_version('werkzeug')
|
||||
|
||||
if parse_version(_werkzeug_version) >= parse_version('2.0.2'):
|
||||
# Werkzeug 2.0.2 adds the websocket option. If a websocket request
|
||||
# (ws/wss) is trying to access an HTTP route, a WebsocketMismatch
|
||||
# exception is raised. On the other hand, Werkzeug 0.16 does not
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue