From ac583226552551cef453b0dec8506ddb7df5bccc Mon Sep 17 00:00:00 2001 From: Alex Coleman Date: Tue, 21 Nov 2023 14:04:36 +0000 Subject: [PATCH] Get werkzeug version using importlib --- authlib/integrations/flask_oauth2/errors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authlib/integrations/flask_oauth2/errors.py b/authlib/integrations/flask_oauth2/errors.py index 23c9e57c..fb2f3a1f 100644 --- a/authlib/integrations/flask_oauth2/errors.py +++ b/authlib/integrations/flask_oauth2/errors.py @@ -1,7 +1,9 @@ +import importlib + import werkzeug from werkzeug.exceptions import HTTPException -_version = werkzeug.__version__.split('.')[0] +_version = importlib.metadata.version('werkzeug').split('.')[0] if _version in ('0', '1'): class _HTTPException(HTTPException):