aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-05-29 20:29:28 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-19 23:45:43 +0200
commitd012b5b997e917a971bca1236a065453493c780d (patch)
treeb7e0737ea9d22d2a6b0b3a0a29bdc7c78d824ea5 /mesonbuild/interpreter.py
parente984e1072b28abfa4ac278992a8ef6d138c15608 (diff)
downloadmeson-d012b5b997e917a971bca1236a065453493c780d.zip
meson-d012b5b997e917a971bca1236a065453493c780d.tar.gz
meson-d012b5b997e917a971bca1236a065453493c780d.tar.bz2
Create a helper for checking if a string has a path component
This is used in a number of places, and in some places it is incomplete. Use a helper to ensure it's used properly.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index cab8bf3..1a1f6b4 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -21,7 +21,7 @@ from . import optinterpreter
from . import compilers
from .wrap import wrap, WrapMode
from . import mesonlib
-from .mesonlib import FileMode, Popen_safe, listify, extract_as_list
+from .mesonlib import FileMode, Popen_safe, listify, extract_as_list, has_path_sep
from .dependencies import ExternalProgram
from .dependencies import InternalDependency, Dependency, DependencyException
from .interpreterbase import InterpreterBase
@@ -1863,7 +1863,7 @@ external dependencies (including libraries) must go to "dependencies".''')
raise InterpreterException('Subproject name must not contain a ".." path segment.')
if os.path.isabs(dirname):
raise InterpreterException('Subproject name must not be an absolute path.')
- if '\\' in dirname or '/' in dirname:
+ if has_path_sep(dirname):
mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.')
if dirname in self.subproject_stack:
fullstack = self.subproject_stack + [dirname]