diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-24 15:11:01 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-24 15:11:01 -0700 |
commit | 1628dd41b609fd4e996a949b9be2f6e4ea62cfc1 (patch) | |
tree | 8eeca2e30399c4de047b08b035e3374c72392297 | |
parent | f0dde60a20bbbf750f6833c624c0c5bf20c7ac9c (diff) | |
download | cryptography-1628dd41b609fd4e996a949b9be2f6e4ea62cfc1.tar.gz cryptography-1628dd41b609fd4e996a949b9be2f6e4ea62cfc1.tar.bz2 cryptography-1628dd41b609fd4e996a949b9be2f6e4ea62cfc1.zip |
Also switch to the explicit verifier construction approach, so the diff for disabling implicit compile is even shorter
-rw-r--r-- | cryptography/hazmat/bindings/utils.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cryptography/hazmat/bindings/utils.py b/cryptography/hazmat/bindings/utils.py index 7d8fc66d..63334ff1 100644 --- a/cryptography/hazmat/bindings/utils.py +++ b/cryptography/hazmat/bindings/utils.py @@ -17,7 +17,8 @@ import binascii import sys -import cffi +from cffi import FFI +from cffi.verifier import Verifier def build_ffi_for_binding(module_prefix, modules, pre_include="", @@ -89,17 +90,20 @@ def build_ffi_for_binding(module_prefix, modules, pre_include="", def build_ffi(cdef_source, verify_source, libraries=[], extra_compile_args=[], extra_link_args=[]): - ffi = cffi.FFI() + ffi = FFI() ffi.cdef(cdef_source) - lib = ffi.verify( - source=verify_source, + + ffi.verifier = Verifier( + ffi, + verify_source, + tmpdir='', modulename=_create_modulename(cdef_source, verify_source, sys.version), libraries=libraries, ext_package="cryptography", extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, ) - return ffi, lib + return ffi, ffi.verifier.load_library() def _create_modulename(cdef_sources, source, sys_version): |