diff options
author | Nicolas Hennion <nicolashennion@gmail.com> | 2024-05-16 08:46:27 +0000 |
---|---|---|
committer | Nicolas Hennion <nicolashennion@gmail.com> | 2024-05-16 08:46:27 +0000 |
commit | f6545580dbd7e35174e7bda634a6be2b49030e56 (patch) | |
tree | 9dd31dc43bbc8b588e29baf19beae5f9470ba046 /glances | |
parent | d94b0b4e924af846073159c1b478de2dd3af35e9 (diff) |
In codeSpace (with Python 3.8), an error occurs in ./unittest-restful.py #2773
Diffstat (limited to 'glances')
-rw-r--r-- | glances/outputs/glances_restful_api.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/glances/outputs/glances_restful_api.py b/glances/outputs/glances_restful_api.py index b65f77d1..c07ccba9 100644 --- a/glances/outputs/glances_restful_api.py +++ b/glances/outputs/glances_restful_api.py @@ -16,8 +16,12 @@ from io import open import webbrowser from urllib.parse import urljoin -# Replace typing_extensions by typing when Python 3.8 support will be dropped -from typing import Annotated +try: + from typing import Annotated +except ImportError: + # Only for Python 3.8 + # To be removed when Python 3.8 support will be dropped + from typing_extensions import Annotated from glances import __version__, __apiversion__ from glances.password import GlancesPassword |