summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2022-01-30 20:01:20 +0100
committerGitHub <noreply@github.com>2022-01-30 14:01:20 -0500
commitca63d31ec214125aea1e4990f11c5ecd25fac29b (patch)
tree66ce24f87a173b7bc76ebe6081ce1f91a2e1aa8c
parentc3cdcfdecd9110d10e4105637b33c3000b6c60a9 (diff)
downloadpyopenssl-ca63d31ec214125aea1e4990f11c5ecd25fac29b.tar.gz
X509Name: Raise AttributeError correctly (#1088)
X509Name does only inherit from object, which has no __getattr__() method. By accident this also raised an AttributeError but the error message is confusing. This commit now raises the AttributeError with a descriptive message.
-rw-r--r--src/OpenSSL/crypto.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 894d5fa..8d24742 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -620,7 +620,7 @@ class X509Name:
_raise_current_error()
except Error:
pass
- return super(X509Name, self).__getattr__(name)
+ raise AttributeError("No such attribute")
entry_index = _lib.X509_NAME_get_index_by_NID(self._name, nid, -1)
if entry_index == -1: