aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
diff options
context:
space:
mode:
authorAleksey Filippov <alekseyf@google.com>2018-01-29 00:10:43 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-30 07:08:22 +1100
commit2cf85ae16f79b5edcbfa34d57b477c984c79e7a5 (patch)
treef0c533465924188dec1a95926ae48b4c63c00309 /mesonbuild/compilers/cpp.py
parent4e5ad57161a475dfab1c1a4edde075b2620b9f75 (diff)
downloadmeson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.zip
meson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.tar.gz
meson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.tar.bz2
Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r--mesonbuild/compilers/cpp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 3a7e753..c10f38e 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -130,7 +130,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
return []
def get_pch_use_args(self, pch_dir, header):
- return ['-fpch-preprocess', '-include', os.path.split(header)[-1]]
+ return ['-fpch-preprocess', '-include', os.path.basename(header)]
class IntelCPPCompiler(IntelCompiler, CPPCompiler):