diff options
author | Aleksey Filippov <alekseyf@google.com> | 2018-01-29 00:10:43 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-01-30 07:08:22 +1100 |
commit | 2cf85ae16f79b5edcbfa34d57b477c984c79e7a5 (patch) | |
tree | f0c533465924188dec1a95926ae48b4c63c00309 /mesonbuild/backend/xcodebackend.py | |
parent | 4e5ad57161a475dfab1c1a4edde075b2620b9f75 (diff) | |
download | meson-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/backend/xcodebackend.py')
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index aca3aea..3ae31e4 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -311,7 +311,7 @@ class XCodeBackend(backends.Backend): for fname, idval in self.filemap.items(): fullpath = os.path.join(self.environment.get_source_dir(), fname) xcodetype = self.get_xcodetype(fname) - name = os.path.split(fname)[-1] + name = os.path.basename(fname) path = fname self.ofile.write(src_templ % (idval, fullpath, xcodetype, name, path)) target_templ = '%s /* %s */ = { isa = PBXFileReference; explicitFileType = "%s"; path = %s; refType = %d; sourceTree = BUILT_PRODUCTS_DIR; };\n' |