From f9d2fc39ec0016807c9dc65edf84ee3f9224829a Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Mon, 12 Feb 2024 12:10:33 +0100 Subject: [PATCH] mypy fix --- caimira/profiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/caimira/profiler.py b/caimira/profiler.py index a5f67576..6c39212e 100644 --- a/caimira/profiler.py +++ b/caimira/profiler.py @@ -9,7 +9,7 @@ import typing from datetime import datetime from enum import Enum from functools import wraps -from pstats import f8, func_std_string +from pstats import f8, func_std_string # type: ignore from pyinstrument import Profiler as PyInstrumentProfiler @@ -134,12 +134,12 @@ class Profiler: class CaimiraProfiler: + _cache_dirpath: str + _cache_filepath: str CACHE_DIR: str = os.environ.get("CAIMIRA_PROFILER_CACHE_DIR", "/tmp") ROOT_URL: str = "/profiler" - _cache_dirpath: str = None - _cache_filepath: str = None - def __init__(self, cache_dir: typing.Optional[str] = None): + def __init__(self): _cache_dir = os.path.join(self.CACHE_DIR, "caimira-profiler") self._cache_dirpath = _cache_dir self._cache_filepath = os.path.join(_cache_dir, "active") @@ -209,7 +209,7 @@ class CaimiraProfiler: def start_session( self, name: typing.Optional[str] = None, - profiler_type: typing.Optional[Profilers] = Profilers.PYINSTRUMENT, + profiler_type: Profilers = Profilers.PYINSTRUMENT, ): """Start a new session, assigning the given name.""" now = datetime.utcnow().isoformat()