update to python3.7
This commit is contained in:
parent
da2d24a7f4
commit
80c4a755da
2912 changed files with 206832 additions and 100407 deletions
45
lib/python3.7/site-packages/asn1crypto/_ffi.py
Normal file
45
lib/python3.7/site-packages/asn1crypto/_ffi.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# coding: utf-8
|
||||
|
||||
"""
|
||||
FFI helper compatibility functions. Exports the following items:
|
||||
|
||||
- LibraryNotFoundError
|
||||
- FFIEngineError
|
||||
- bytes_from_buffer()
|
||||
- buffer_from_bytes()
|
||||
- null()
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, division, absolute_import, print_function
|
||||
|
||||
from ctypes import create_string_buffer
|
||||
|
||||
|
||||
def buffer_from_bytes(initializer):
|
||||
return create_string_buffer(initializer)
|
||||
|
||||
|
||||
def bytes_from_buffer(buffer, maxlen=None):
|
||||
return buffer.raw
|
||||
|
||||
|
||||
def null():
|
||||
return None
|
||||
|
||||
|
||||
class LibraryNotFoundError(Exception):
|
||||
|
||||
"""
|
||||
An exception when trying to find a shared library
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class FFIEngineError(Exception):
|
||||
|
||||
"""
|
||||
An exception when trying to instantiate ctypes or cffi
|
||||
"""
|
||||
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue