From 36462278736b95c3665dafadddf6ebd98aa0b8b7 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:13:00 -0800 Subject: [PATCH] Fixed SIM101 (duplicate-isinstance-call): Multiple `isinstance` calls for `pem`, merge into a single call --- management/ssl_certificates.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/management/ssl_certificates.py b/management/ssl_certificates.py index effb6ace..f7d481a8 100755 --- a/management/ssl_certificates.py +++ b/management/ssl_certificates.py @@ -63,9 +63,7 @@ def get_ssl_certificates(env): if isinstance(pem, Certificate): certificates.append({ "filename": fn, "cert": pem }) # It is a private key - elif (isinstance(pem, rsa.RSAPrivateKey) - or isinstance(pem, dsa.DSAPrivateKey) - or isinstance(pem, ec.EllipticCurvePrivateKey)): + elif (isinstance(pem, (rsa.RSAPrivateKey, dsa.DSAPrivateKey, ec.EllipticCurvePrivateKey))): private_keys[pem.public_key().public_numbers()] = { "filename": fn, "key": pem }