summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
Diffstat (limited to 'pylint')
-rw-r--r--pylint/checkers/raw_metrics.py3
-rw-r--r--pylint/utils/utils.py9
2 files changed, 5 insertions, 7 deletions
diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py
index bb3a519d4..0bdd20f69 100644
--- a/pylint/checkers/raw_metrics.py
+++ b/pylint/checkers/raw_metrics.py
@@ -24,8 +24,7 @@ from pylint.utils import diff_string
def report_raw_stats(sect, stats, old_stats):
- """calculate percentage of code / doc / comment / empty
- """
+ """calculate percentage of code / doc / comment / empty"""
total_lines = stats["total_lines"]
if not total_lines:
raise EmptyReportError()
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py
index 354d5a47a..93324d078 100644
--- a/pylint/utils/utils.py
+++ b/pylint/utils/utils.py
@@ -36,11 +36,10 @@ def normalize_text(text, line_len=DEFAULT_LINE_LENGTH, indent=""):
CMPS = ["=", "-", "+"]
-# py3k has no more cmp builtin
-if sys.version_info >= (3, 0):
- def cmp(a, b): # pylint: disable=redefined-builtin
- return (a > b) - (a < b)
+# py3k has no more cmp builtin
+def cmp(a, b): # pylint: disable=redefined-builtin
+ return (a > b) - (a < b)
def diff_string(old, new):
@@ -48,7 +47,7 @@ def diff_string(old, new):
difference
"""
diff = abs(old - new)
- diff_str = "%s%s" % (CMPS[cmp(old, new)], diff and ("%.2f" % diff) or "")
+ diff_str = "{}{}".format(CMPS[cmp(old, new)], diff and ("%.2f" % diff) or "")
return diff_str