aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/coredata.py4
-rw-r--r--mesonbuild/mesonlib.py25
-rw-r--r--mesonbuild/mesonmain.py4
3 files changed, 4 insertions, 29 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index d4a91a7..0fdac8b 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -18,7 +18,7 @@ import pickle, os, uuid
import sys
from pathlib import PurePath
from collections import OrderedDict
-from .mesonlib import MesonException, commonpath
+from .mesonlib import MesonException
from .mesonlib import default_libdir, default_libexecdir, default_prefix
import ast
@@ -274,7 +274,7 @@ class CoreData:
# commonpath will always return a path in the native format, so we
# must use pathlib.PurePath to do the same conversion before
# comparing.
- if commonpath([value, prefix]) != str(PurePath(prefix)):
+ if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
m = 'The value of the {!r} option is {!r} which must be a ' \
'subdir of the prefix {!r}.\nNote that if you pass a ' \
'relative path, it is assumed to be a subdir of prefix.'
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
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 12bbd69..e48122f 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -279,8 +279,8 @@ def run_script_command(args):
return cmdfunc(cmdargs)
def run(original_args, mainfile=None):
- if sys.version_info < (3, 4):
- print('Meson works correctly only with python 3.4+.')
+ if sys.version_info < (3, 5):
+ print('Meson works correctly only with python 3.5+.')
print('You have python %s.' % sys.version)
print('Please update your environment')
return 1