From 2a362bea979de8b74a6747e1c6064f22dc466a18 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 6 Jun 2018 17:02:08 -0400 Subject: [PATCH] ignore python2-specific code under python3 for pep8 The type 'long' no longer exists under python 3. The runtime execution of the code using it in the metrics module already detects the python version, but when the linter is run under python 3 it does not apply the same check. Add a noqa pragma to tell the linter to ignore the line where 'long' is referenced to avoid an error. Change-Id: If806e6461358ea523708eceed6fdcc3dfb8d75a9 Signed-off-by: Doug Hellmann --- monasca_common/validation/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monasca_common/validation/metrics.py b/monasca_common/validation/metrics.py index c7da5bb9..816f9121 100644 --- a/monasca_common/validation/metrics.py +++ b/monasca_common/validation/metrics.py @@ -38,7 +38,7 @@ NUMERIC_VALUES = [int, float] if six.PY2: # according to PEP537 long was renamed to int in PY3 # need to add long, as possible value, for PY2 - NUMERIC_VALUES += [long] + NUMERIC_VALUES += [long] # noqa NUMERIC_VALUES = tuple(NUMERIC_VALUES) # convert to tuple for instance call