aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/gettext.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/scripts/gettext.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/scripts/gettext.py')
-rw-r--r--mesonbuild/scripts/gettext.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/scripts/gettext.py b/mesonbuild/scripts/gettext.py
index 30ac54c..f308c5a 100644
--- a/mesonbuild/scripts/gettext.py
+++ b/mesonbuild/scripts/gettext.py
@@ -81,7 +81,7 @@ def do_install(src_sub, bld_sub, dest, pkgname, langs):
srcfile = os.path.join(bld_sub, l + '.gmo')
outfile = os.path.join(dest, l, 'LC_MESSAGES',
pkgname + '.mo')
- os.makedirs(os.path.split(outfile)[0], exist_ok=True)
+ os.makedirs(os.path.dirname(outfile), exist_ok=True)
shutil.copyfile(srcfile, outfile)
shutil.copystat(srcfile, outfile)
print('Installing %s to %s' % (srcfile, outfile))