diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
commit | 2df9b1c35cbb5c92204fc5923368a3d619a34f6d (patch) | |
tree | d1ede8ffef812ba4e345b08f698f001ebe69cb56 /igor.py | |
parent | 84221611890880b749dbb650e8d07ac8918dba46 (diff) | |
parent | 7c66441eab3af17539c478a2cb4e19cd93ba0cf4 (diff) | |
download | python-coveragepy-git-2df9b1c35cbb5c92204fc5923368a3d619a34f6d.tar.gz |
Merged 4.0 to default
Diffstat (limited to 'igor.py')
-rw-r--r-- | igor.py | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -62,11 +62,8 @@ def run_tests_with_coverage(tracer, *nose_args): import nose pth_dir = os.path.dirname(os.path.dirname(nose.__file__)) pth_path = os.path.join(pth_dir, "covcov.pth") - pth_file = open(pth_path, "w") - try: + with open(pth_path, "w") as pth_file: pth_file.write("import coverage; coverage.process_startup()\n") - finally: - pth_file.close() version = "%s%s" % sys.version_info[:2] suffix = "%s_%s_%s" % (version, tracer, socket.gethostname()) @@ -161,17 +158,17 @@ def do_check_eol(): checked.add(fname) line = None - for n, line in enumerate(open(fname, "rb")): + for n, line in enumerate(open(fname, "rb"), start=1): if crlf: if "\r" in line: - print("%s@%d: CR found" % (fname, n+1)) + print("%s@%d: CR found" % (fname, n)) return if trail_white: line = line[:-1] if not crlf: line = line.rstrip('\r') if line.rstrip() != line: - print("%s@%d: trailing whitespace found" % (fname, n+1)) + print("%s@%d: trailing whitespace found" % (fname, n)) return if line is not None and not line.strip(): @@ -216,7 +213,7 @@ def print_banner(label): if '__pypy__' in sys.builtin_module_names: pypy_version = sys.pypy_version_info # pylint: disable=E1101 - version += " (pypy %s)" % ".".join([str(v) for v in pypy_version]) + version += " (pypy %s)" % ".".join(str(v) for v in pypy_version) print('=== %s %s %s (%s) ===' % (impl, version, label, sys.executable)) |