diff --git a/src/flask_debugtoolbar/panels/versions.py b/src/flask_debugtoolbar/panels/versions.py index 4a90d48..7d8e239 100644 --- a/src/flask_debugtoolbar/panels/versions.py +++ b/src/flask_debugtoolbar/panels/versions.py @@ -1,9 +1,19 @@ import os from sysconfig import get_path -from flask import __version__ as flask_version from flask_debugtoolbar.panels import DebugPanel +try: + # Python 3.8+ + from importlib.metadata import version + + flask_version = version('flask') + +except ImportError: + import pkg_resources + + flask_version = pkg_resources.get_distribution('flask').version + _ = lambda x: x