From 6bc0e16aa522350222ec558d9ea2f0c7d9a4905b Mon Sep 17 00:00:00 2001 From: zouzhimin Date: Mon, 29 Apr 2024 12:00:39 +0800 Subject: [PATCH] fixes for E721 errors raised by flake8 --- ...or-E721-errors-raised-by-flake8-1289.patch | 59 +++++++++++++++++++ pyOpenSSL.spec | 6 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 fix-for-E721-errors-raised-by-flake8-1289.patch diff --git a/fix-for-E721-errors-raised-by-flake8-1289.patch b/fix-for-E721-errors-raised-by-flake8-1289.patch new file mode 100644 index 0000000..df935a8 --- /dev/null +++ b/fix-for-E721-errors-raised-by-flake8-1289.patch @@ -0,0 +1,59 @@ +From 1508c4b8cde2cb53c9b04a6b7b1185ea25c0ec01 Mon Sep 17 00:00:00 2001 +From: julianz- +Date: Fri, 26 Jan 2024 10:42:55 -0800 +Subject: [PATCH] fix for E721 errors raised by flake8 (#1289) + +--- + tests/test_crypto.py | 8 ++++---- + tests/test_ssl.py | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/tests/test_crypto.py b/tests/test_crypto.py +index 3d1bf82..b9bb0de 100644 +--- a/tests/test_crypto.py ++++ b/tests/test_crypto.py +@@ -1740,7 +1740,7 @@ class TestX509(_PKeyInteractionTestsMixin): + certificate = X509() + assert isinstance(certificate, X509) + assert type(certificate).__name__ == "X509" +- assert type(certificate) == X509 ++ assert type(certificate) is X509 + + def test_set_version_wrong_args(self): + """ +@@ -3148,7 +3148,7 @@ class TestRevoked: + """ + revoked = Revoked() + assert isinstance(revoked, Revoked) +- assert type(revoked) == Revoked ++ assert type(revoked) is Revoked + assert revoked.get_serial() == b"00" + assert revoked.get_rev_date() is None + assert revoked.get_reason() is None +@@ -3443,8 +3443,8 @@ class TestCRL: + + revs = crl.get_revoked() + assert len(revs) == 2 +- assert type(revs[0]) == Revoked +- assert type(revs[1]) == Revoked ++ assert type(revs[0]) is Revoked ++ assert type(revs[1]) is Revoked + assert revs[0].get_serial() == b"03AB" + assert revs[1].get_serial() == b"0100" + assert revs[0].get_rev_date() == now +diff --git a/tests/test_ssl.py b/tests/test_ssl.py +index ca5bf83..5ea068a 100644 +--- a/tests/test_ssl.py ++++ b/tests/test_ssl.py +@@ -190,7 +190,7 @@ def join_bytes_or_unicode(prefix, suffix): + The return type is the same as the type of ``prefix``. + """ + # If the types are the same, nothing special is necessary. +- if type(prefix) == type(suffix): ++ if type(prefix) is type(suffix): + return join(prefix, suffix) + + # Otherwise, coerce suffix to the type of prefix. +-- +2.25.1 + diff --git a/pyOpenSSL.spec b/pyOpenSSL.spec index 662edf6..0eee5a8 100644 --- a/pyOpenSSL.spec +++ b/pyOpenSSL.spec @@ -1,11 +1,12 @@ Name: pyOpenSSL Version: 24.0.0 -Release: 1 +Release: 2 Summary: A rather thin wrapper around (a subset of) the OpenSSL library. License: ASL 2.0 URL: https://www.pyopenssl.org/en/stable/ Source0: https://github.com/pyca/pyopenssl/archive/%{version}.tar.gz +Patch0: fix-for-E721-errors-raised-by-flake8-1289.patch BuildArch: noarch BuildRequires: python3-devel python3-cryptography @@ -58,6 +59,9 @@ make -C doc html SPHINXBUILD=sphinx-build-3 %doc CHANGELOG.rst doc/_build/html %changelog +* Sat May 11 2024 zouzhimin - 24.0.0-2 +- fixes for E721 errors raised by flake8 + * Wed Jan 24 2024 zhengxiaoxiao - 24.0.0-1 - Upgrade version to 24.0.0 - Dropped support for Python 3.6. -- Gitee