Skip to content

Commit

Permalink
Ignore mypy
Browse files Browse the repository at this point in the history
python/mypy#1927
Signed-off-by: Yury Pliner <[email protected]>
  • Loading branch information
Pliner committed Feb 8, 2022
1 parent 0ab483c commit d7183b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prometheus_client/context_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __call__(self, f: "F") -> "F":
def wrapped(*args: Any, **kwargs: Any) -> Any:
with self:
return f(*args, **kwargs)
return wrapped
return wrapped # type: ignore


class InprogressTracker:
Expand All @@ -43,12 +43,12 @@ def __enter__(self):
def __exit__(self, typ, value, traceback):
self._gauge.dec()

def __call__(self, f):
def __call__(self, f: "F") -> "F":
@functools.wraps(f)
def wrapped(*args: Any, **kwargs: Any) -> Any:
with self:
return f(*args, **kwargs)
return wrapped
return wrapped # type: ignore


class Timer:
Expand All @@ -72,9 +72,9 @@ def __exit__(self, typ, value, traceback):
def labels(self, *args, **kw):
self._metric = self._metric.labels(*args, **kw)

def __call__(self, f):
def __call__(self, f: "F") -> "F":
@functools.wraps(f)
def wrapped(*args: Any, **kwargs: Any) -> Any:
with self._new_timer():
return f(*args, **kwargs)
return wrapped
return wrapped # type: ignore

0 comments on commit d7183b9

Please sign in to comment.