diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-18 19:44:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 19:44:57 +0300 |
commit | 5ec6151e56140a19ef185052ffb02bd1ff957bd7 (patch) | |
tree | 53346478d8e84aefd170ac6226938ca89d6d0a77 /mesonbuild/scripts | |
parent | a31bc4ede5883d449c15c90535b21bc8f9e28d6d (diff) | |
parent | 0e56ec2dbdbbd463d608c42e0aa117357e18936a (diff) | |
download | meson-5ec6151e56140a19ef185052ffb02bd1ff957bd7.zip meson-5ec6151e56140a19ef185052ffb02bd1ff957bd7.tar.gz meson-5ec6151e56140a19ef185052ffb02bd1ff957bd7.tar.bz2 |
Merge pull request #1810 from QuLogic/pycharm-warnings
Fix various warnings found in PyCharm
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/delwithsuffix.py | 6 | ||||
-rw-r--r-- | mesonbuild/scripts/dist.py | 8 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_install.py | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/mesonbuild/scripts/delwithsuffix.py b/mesonbuild/scripts/delwithsuffix.py index bd34202..0d410ae 100644 --- a/mesonbuild/scripts/delwithsuffix.py +++ b/mesonbuild/scripts/delwithsuffix.py @@ -15,12 +15,12 @@ import os, sys def run(args): - if len(sys.argv) != 3: + if len(args) != 2: print('delwithsuffix.py <root of subdir to process> <suffix to delete>') sys.exit(1) - topdir = sys.argv[1] - suffix = sys.argv[2] + topdir = args[0] + suffix = args[1] if suffix[0] != '.': suffix = '.' + suffix diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py index ba6df7d..f17b296 100644 --- a/mesonbuild/scripts/dist.py +++ b/mesonbuild/scripts/dist.py @@ -13,9 +13,8 @@ # limitations under the License. -import os, sys +import os import shutil -import argparse import subprocess import pickle import hashlib @@ -113,7 +112,7 @@ def check_dist(packagename, meson_command): print('Installing the distribution package failed.') return 1 finally: - shutil.rmtree(srcdir) + shutil.rmtree(unpackdir) shutil.rmtree(builddir) shutil.rmtree(installdir) print('Distribution package %s tested.' % packagename) @@ -141,8 +140,7 @@ def run(args): error_count = 0 for name in names: rc = check_dist(name, meson_command) # Check only one. - rc = 0 if rc == 0: create_hash(name) error_count += rc - return rc + return 1 if error_count else 0 diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index fbcc2a4..d949090 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -34,7 +34,7 @@ def set_mode(path, mode): except PermissionError as e: msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...' print(msg.format(path, mode.owner, mode.group, e.strerror)) - except LookupError as e: + except LookupError: msg = '{!r}: Non-existent owner {!r} or group {!r}: ignoring...' print(msg.format(path, mode.owner, mode.group)) except OSError as e: |