Skip to content

Commit

Permalink
fix: ReST API - typing imports support for py38
Browse files Browse the repository at this point in the history
fixes #2992
  • Loading branch information
RazCrimson committed Oct 31, 2024
1 parent 8767de5 commit 6ee3683
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions glances/outputs/glances_restful_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import sys
import tempfile
import webbrowser
from typing import Any, Union
from urllib.parse import urljoin

from glances.stats import GlancesStats

try:
from typing import Annotated, Any
from typing import Annotated
except ImportError:
# Only for Python 3.8
# To be removed when Python 3.8 support will be dropped
Expand Down Expand Up @@ -622,7 +623,7 @@ def _api_item_unit(self, plugin: str, item: str):
else:
return GlancesJSONResponse(ret)

def _api_value(self, plugin: str, item: str, value: Any):
def _api_value(self, plugin: str, item: str, value: Union[str, int, float]):
"""Glances API RESTful implementation.
Return the process stats (dict) for the given item=value
Expand Down

0 comments on commit 6ee3683

Please sign in to comment.