From 6e3170ab3d4a48c6e28867f37828054580631c69 Mon Sep 17 00:00:00 2001 From: Manish Giri Date: Wed, 8 Jul 2020 09:24:49 +0000 Subject: [PATCH] Bug 1650306 - Address the defects found by the pylint/no-else-return rule. r=sylvestre Differential Revision: https://phabricator.services.mozilla.com/D82508 --- client.py | 3 +-- security/manager/ssl/tests/unit/pykey.py | 4 ++-- security/manager/ssl/tests/unit/sign_app.py | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client.py b/client.py index 9d6d8e502ea1..ad6c1ab7fa7f 100755 --- a/client.py +++ b/client.py @@ -107,8 +107,7 @@ def get_trailing_blank_line_state(depname): if not lines[-1].strip(): return "has blank line" - else: - return "no blank line" + return "no blank line" def update_nspr_or_nss(tag, depfile, destination, hgpath): diff --git a/security/manager/ssl/tests/unit/pykey.py b/security/manager/ssl/tests/unit/pykey.py index 5c2c2e84f639..8b838db0d298 100755 --- a/security/manager/ssl/tests/unit/pykey.py +++ b/security/manager/ssl/tests/unit/pykey.py @@ -819,8 +819,8 @@ def keyFromSpecification(specification): """Pass in a specification, get the appropriate key back.""" if specification.startswith('secp'): return ECCKey(specification) - else: - return RSAKey(specification) + return RSAKey(specification) + # The build harness will call this function with an output file-like # object and a path to a file containing a specification. This will diff --git a/security/manager/ssl/tests/unit/sign_app.py b/security/manager/ssl/tests/unit/sign_app.py index 957584c4b994..3eee24f41548 100755 --- a/security/manager/ssl/tests/unit/sign_app.py +++ b/security/manager/ssl/tests/unit/sign_app.py @@ -37,12 +37,12 @@ def coseAlgorithmToPykeyHash(algorithm): and returns the corresponding pykey.HASH_* identifier.""" if algorithm == ES256: return pykey.HASH_SHA256 - elif algorithm == ES384: + if algorithm == ES384: return pykey.HASH_SHA384 - elif algorithm == ES512: + if algorithm == ES512: return pykey.HASH_SHA512 - else: - raise UnknownCOSEAlgorithmError(algorithm) + raise UnknownCOSEAlgorithmError(algorithm) + # COSE_Signature = [ # protected : serialized_map,