| 1 |
From: Federico Ceratto <[email protected]> |
| 2 |
Last-Update: 2022-02-18 |
| 3 |
Subject: Use packaged decorator.py |
| 4 |
Forwarded: not-needed |
| 5 |
|
| 6 |
--- |
| 7 |
--- a/prometheus_client/context_managers.py |
| 8 |
+++ b/prometheus_client/context_managers.py |
| 9 |
@@ -5,7 +5,7 @@ |
| 10 |
Union, |
| 11 |
) |
| 12 |
|
| 13 |
|
| 14 |
+from decorator import decorate |
| 15 |
|
| 16 |
if TYPE_CHECKING: |
| 17 |
from . import Counter |
| 18 |
--- a/tests/test_core.py |
| 19 |
+++ b/tests/test_core.py |
| 20 |
@@ -12,9 +12,16 @@ |
| 21 |
HistogramMetricFamily, Info, InfoMetricFamily, Metric, Sample, |
| 22 |
StateSetMetricFamily, Summary, SummaryMetricFamily, UntypedMetricFamily, |
| 23 |
) |
| 24 |
|
| 25 |
from prometheus_client.metrics import _get_use_created |
| 26 |
|
| 27 |
+from inspect import getfullargspec |
| 28 |
+ |
| 29 |
+ |
| 30 |
+def getargspec(f): |
| 31 |
+ """A replacement for inspect.getargspec""" |
| 32 |
+ spec = getfullargspec(f) |
| 33 |
+ return spec.args, spec.varargs, spec.varkw, spec.defaults |
| 34 |
+ |
| 35 |
|
| 36 |
def assert_not_observable(fn, *args, **kwargs): |
| 37 |
""" |