summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-05-17 10:06:40 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-05-17 10:06:40 -0400
commit34413aab8a61579789faa342331ac9c8a55ee5a4 (patch)
tree47850ea0d7622978a1ea2484f1d5955364896076 /coverage/misc.py
parent6754971e7ef16e5cee60ae5532de8f6069768ce8 (diff)
downloadpython-coveragepy-git-34413aab8a61579789faa342331ac9c8a55ee5a4.tar.gz
WIP for partial branch exclusion. #113
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index 4f3748fe..ec0d0ff7 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -73,6 +73,14 @@ def bool_or_none(b):
return bool(b)
+def join_regex(regexes):
+ """Combine a list of regexes into one that matches any of them."""
+ if len(regexes) > 1:
+ return "(" + ")|(".join(regexes) + ")"
+ else:
+ return regexes[0]
+
+
class Hasher(object):
"""Hashes Python data into md5."""
def __init__(self):