Simplify conditions and delete an unused function (#512)
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index c31a9d2..116cc51 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -2130,9 +2130,7 @@
:return: True if the PKCS7 is of type signed
"""
- if _lib.PKCS7_type_is_signed(self._pkcs7):
- return True
- return False
+ return bool(_lib.PKCS7_type_is_signed(self._pkcs7))
def type_is_enveloped(self):
"""
@@ -2140,9 +2138,7 @@
:returns: True if the PKCS7 is of type enveloped
"""
- if _lib.PKCS7_type_is_enveloped(self._pkcs7):
- return True
- return False
+ return bool(_lib.PKCS7_type_is_enveloped(self._pkcs7))
def type_is_signedAndEnveloped(self):
"""
@@ -2150,9 +2146,7 @@
:returns: True if the PKCS7 is of type signedAndEnveloped
"""
- if _lib.PKCS7_type_is_signedAndEnveloped(self._pkcs7):
- return True
- return False
+ return bool(_lib.PKCS7_type_is_signedAndEnveloped(self._pkcs7))
def type_is_data(self):
"""
@@ -2160,9 +2154,7 @@
:return: True if the PKCS7 is of type data
"""
- if _lib.PKCS7_type_is_data(self._pkcs7):
- return True
- return False
+ return bool(_lib.PKCS7_type_is_data(self._pkcs7))
def get_type_name(self):
"""