Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setup_module():
import cffi.verifier
cffi.verifier.cleanup_tmpdir()
#
# check that no $ sign is produced in the C file; it used to be the
# case that anonymous enums would produce '$enum_$1', which was
# used as part of a function name. GCC accepts such names, but it's
# apparently non-standard.
_r_comment = re.compile(r"/\*.*?\*/|//.*?$", re.DOTALL | re.MULTILINE)
_r_string = re.compile(r'\".*?\"')
def _write_source_and_check(self, file=None):
base_write_source(self, file)
if file is None:
f = open(self.sourcefilename)
data = f.read()
f.close()
data = _r_comment.sub(' ', data)
data = _r_string.sub('"skipped"', data)
assert '$' not in data
def setup_module():
import cffi.verifier
cffi.verifier.cleanup_tmpdir(keep_so=True)
def setup_module():
cffi.verifier.cleanup_tmpdir(keep_so=True)
cffi.verifier._FORCE_GENERIC_ENGINE = True
def setup_module():
cffi.verifier.cleanup_tmpdir()
cffi.verifier._FORCE_GENERIC_ENGINE = True
# Runs all tests with _FORCE_GENERIC_ENGINE = True, to make sure we
"""pyuv_cffi - an implementation of pyuv via CFFI
Compatible with CPython 3 and pypy3
"""
import os
import functools
import cffi
import cffi.verifier
from cffi import VerificationError
__version__ = '0.1.0'
version_info = tuple(map(int, __version__.split('.')))
# clean up old compiled library binaries (not needed in production?)
cffi.verifier.cleanup_tmpdir()
thisdir = os.path.dirname(os.path.realpath(__file__))
# load FFI definitions and custom C code
ffi = cffi.FFI()
with open(os.path.join(thisdir, 'pyuv_cffi_cdef.c')) as f:
ffi.cdef(f.read())
try:
with open(os.path.join(thisdir, 'pyuv_cffi.c')) as f:
libuv = ffi.verify(f.read(), libraries=['uv'])
except VerificationError as e:
print(e)
exit(1)
UV_READABLE = libuv.UV_READABLE
@staticmethod
def clean():
cffi.verifier.cleanup_tmpdir()