aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-09 09:43:11 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-08-09 09:43:11 -0500
commit84e7f1e04e694e115b207d51a3e6812918df212b (patch)
treeb34b8c2f3ed8a9de8565db39b74267a49479d792 /src
parent91e385d123e93cb9a787784f93e46509b78aa362 (diff)
downloadcryptography-84e7f1e04e694e115b207d51a3e6812918df212b.tar.gz
cryptography-84e7f1e04e694e115b207d51a3e6812918df212b.tar.bz2
cryptography-84e7f1e04e694e115b207d51a3e6812918df212b.zip
move encode out of try blocks
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index 2712abcb..ad88dd9d 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -1195,10 +1195,10 @@ class Backend(object):
for extension in builder._extensions:
try:
encode = _EXTENSION_ENCODE_HANDLERS[extension.oid]
- pp, r = encode(self, extension.value)
except KeyError:
raise NotImplementedError('Extension not yet supported.')
+ pp, r = encode(self, extension.value)
obj = _txt2obj_gc(self, extension.oid.dotted_string)
extension = self._lib.X509_EXTENSION_create_by_OBJ(
self._ffi.NULL,
@@ -1291,10 +1291,10 @@ class Backend(object):
for i, extension in enumerate(builder._extensions):
try:
encode = _EXTENSION_ENCODE_HANDLERS[extension.oid]
- pp, r = encode(self, extension.value)
except KeyError:
raise NotImplementedError('Extension not yet supported.')
+ pp, r = encode(self, extension.value)
obj = _txt2obj_gc(self, extension.oid.dotted_string)
extension = self._lib.X509_EXTENSION_create_by_OBJ(
self._ffi.NULL,