Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: third_party/coverage-3.7.1/coverage/misc.py

Issue 225633007: Upgrade to coverage 3.7.1 and have it auto-build itself on first use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: sigh our imports are a mess Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/coverage-3.7.1/coverage/misc.py
diff --git a/third_party/coverage-3.6/coverage/misc.py b/third_party/coverage-3.7.1/coverage/misc.py
similarity index 93%
rename from third_party/coverage-3.6/coverage/misc.py
rename to third_party/coverage-3.7.1/coverage/misc.py
index ece8023bd451dd75ed99742c20581b92ce168208..0378173fcc3ddc92d00ca94d88d7ef3fec746a25 100644
--- a/third_party/coverage-3.6/coverage/misc.py
+++ b/third_party/coverage-3.7.1/coverage/misc.py
@@ -38,6 +38,8 @@ def format_lines(statements, lines):
i = 0
j = 0
start = None
+ statements = sorted(statements)
+ lines = sorted(lines)
while i < len(statements) and j < len(lines):
if statements[i] == lines[j]:
if start == None:
@@ -86,7 +88,7 @@ def bool_or_none(b):
def join_regex(regexes):
"""Combine a list of regexes into one that matches any of them."""
if len(regexes) > 1:
- return "(" + ")|(".join(regexes) + ")"
+ return "|".join(["(%s)" % r for r in regexes])
elif regexes:
return regexes[0]
else:
@@ -113,8 +115,10 @@ class Hasher(object):
self.md5.update(to_bytes(str(type(v))))
if isinstance(v, string_class):
self.md5.update(to_bytes(v))
+ elif v is None:
+ pass
elif isinstance(v, (int, float)):
- self.update(str(v))
+ self.md5.update(to_bytes(str(v)))
elif isinstance(v, (tuple, list)):
for e in v:
self.update(e)
@@ -146,6 +150,10 @@ class NoSource(CoverageException):
"""We couldn't find the source for a module."""
pass
+class NoCode(NoSource):
+ """We couldn't find any code at all."""
+ pass
+
class NotPython(CoverageException):
"""A source file turned out not to be parsable Python."""
pass
« no previous file with comments | « third_party/coverage-3.7.1/coverage/htmlfiles/style.css ('k') | third_party/coverage-3.7.1/coverage/parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698