diff options
author | Jack Lloyd <[email protected]> | 2018-08-02 17:49:20 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-02 17:49:20 -0400 |
commit | 6e8f5f1a1d5c03ec5c12ce6febe021f9aad00dcd (patch) | |
tree | e458d67df39da00a4e70aafdc3ff1d668e034037 /src/scripts/dist.py | |
parent | 5ed67bfbf96a80af77807443177b4925e0a94797 (diff) |
Fix complaints from latest pylint
Diffstat (limited to 'src/scripts/dist.py')
-rwxr-xr-x | src/scripts/dist.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/scripts/dist.py b/src/scripts/dist.py index 36237c42c..a27784453 100755 --- a/src/scripts/dist.py +++ b/src/scripts/dist.py @@ -100,7 +100,7 @@ def gpg_sign(keyid, passphrase_file, files, detached=True): options = ['--armor', '--detach-sign'] if detached else ['--clearsign'] gpg_cmd = ['gpg', '--batch'] + options + ['--local-user', keyid] - if passphrase_file != None: + if passphrase_file is not None: gpg_cmd[1:1] = ['--passphrase-file', passphrase_file] for filename in files: @@ -248,7 +248,7 @@ def write_archive(output_basename, archive_type, rel_epoch, all_files, hash_file archive_hash = sha256.hexdigest().upper() logging.info('SHA-256(%s) = %s' % (output_archive, archive_hash)) - if hash_file != None: + if hash_file is not None: hash_file.write("%s %s\n" % (archive_hash, output_archive)) return output_archive @@ -259,7 +259,7 @@ def configure_logging(options): super(ExitOnErrorLogHandler, self).emit(record) # Exit script if and ERROR or worse occurred if record.levelno >= logging.ERROR: - if sys.exc_info()[2] != None: + if sys.exc_info()[2] is not None: logging.info(traceback.format_exc()) sys.exit(1) @@ -276,7 +276,7 @@ def configure_logging(options): logging.getLogger().setLevel(log_level()) def main(args=None): - # pylint: disable=too-many-branches,too-many-locals + # pylint: disable=too-many-branches,too-many-locals,too-many-statements if args is None: args = sys.argv[1:] @@ -382,19 +382,19 @@ def main(args=None): output_files = [] hash_file = None - if options.write_hash_file != None: + if options.write_hash_file is not None: hash_file = open(options.write_hash_file, 'w') for archive_type in archives: output_files.append(write_archive(output_basename, archive_type, rel_epoch, all_files, hash_file)) - if hash_file != None: + if hash_file is not None: hash_file.close() shutil.rmtree(output_basename) if options.pgp_key_id != 'none': - if options.write_hash_file != None: + if options.write_hash_file is not None: output_files += gpg_sign(options.pgp_key_id, options.pgp_passphrase_file, [options.write_hash_file], False) else: |