aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 66bf98e..3b32996 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -702,31 +702,6 @@ def Popen_safe_legacy(args, write=None, stderr=subprocess.PIPE, **kwargs):
e = e.decode(errors='replace').replace('\r\n', '\n')
return p, o, e
-def commonpath(paths):
- '''
- For use on Python 3.4 where os.path.commonpath is not available.
- We currently use it everywhere so this receives enough testing.
- '''
- # XXX: Replace me with os.path.commonpath when we start requiring Python 3.5
- import pathlib
- if not paths:
- raise ValueError('arg is an empty sequence')
- common = pathlib.PurePath(paths[0])
- for path in paths[1:]:
- new = []
- path = pathlib.PurePath(path)
- for c, p in zip(common.parts, path.parts):
- if c != p:
- break
- new.append(c)
- # Don't convert '' into '.'
- if not new:
- common = ''
- break
- new = os.path.join(*new)
- common = pathlib.PurePath(new)
- return str(common)
-
def iter_regexin_iter(regexiter, initer):
'''
Takes each regular expression in @regexiter and tries to search for it in