diff --git a/src/cockpit/channels/pcp.py b/src/cockpit/channels/pcp.py index 1f2a62b0e10f..60344a63fdb9 100644 --- a/src/cockpit/channels/pcp.py +++ b/src/cockpit/channels/pcp.py @@ -71,7 +71,7 @@ import sys import time from collections import defaultdict -from typing import TYPE_CHECKING, Any, Iterable, List, NamedTuple, Optional, Sequence +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, NamedTuple, Optional, Sequence from cockpit.protocol import CockpitProblem @@ -92,7 +92,7 @@ class MetricNotFoundError(CockpitProblem): pass -class PcpMetricInfo(dict[str, JsonValue]): +class PcpMetricInfo(Dict[str, JsonValue]): def __init__(self, value: JsonObject) -> None: self.name = get_str(value, 'name') self.derive = get_str(value, 'derive', '') @@ -466,11 +466,11 @@ def sample(self, context: 'pmapi.pmContext', archive_batch: int, limit: int, tot def parse_fetched_results(self, context: 'pmapi.pmContext', results: Any) -> Any: metrics = list(self.metrics) - samples: dict[str, float | list[float]] = {} + samples: Dict[str, float | list[float]] = {} samples['timestamp'] = float(results.contents.timestamp) for i in range(results.contents.numpmid): - values: Optional[dict[str, float] | float] = defaultdict() + values: Optional[Dict[str, float] | float] = defaultdict() numval: int = results.contents.get_numval(i) metric_desc = self.metric_descriptions[i] content_type = metric_desc.desc.type