summaryrefslogtreecommitdiff
path: root/cffi/recompiler.py
diff options
context:
space:
mode:
authorRonan Lamy <ronan.lamy@gmail.com>2018-11-27 18:40:23 +0000
committerRonan Lamy <ronan.lamy@gmail.com>2018-11-27 18:40:23 +0000
commitee96fd83fe5883ac5b5f7880cfbc959f9bf90b4b (patch)
treede4c55110830c51df6b539aa61e9879f557c5f5d /cffi/recompiler.py
parent9178ac12a645f71749b273cc630d41b98001ad6a (diff)
downloadcffi-ee96fd83fe5883ac5b5f7880cfbc959f9bf90b4b.tar.gz
Move test-only function from cffi/ to testing/
Diffstat (limited to 'cffi/recompiler.py')
-rw-r--r--cffi/recompiler.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/cffi/recompiler.py b/cffi/recompiler.py
index 56fa80f..20e912b 100644
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -1540,27 +1540,3 @@ def recompile(ffi, module_name, preamble, tmpdir='.', call_c_compiler=True,
else:
return None, updated
-def _verify(ffi, module_name, preamble, *args, **kwds):
- # FOR TESTS ONLY
- from testing.udir import udir
- import imp
- assert module_name not in sys.modules, "module name conflict: %r" % (
- module_name,)
- kwds.setdefault('tmpdir', str(udir))
- outputfilename = recompile(ffi, module_name, preamble, *args, **kwds)
- module = imp.load_dynamic(module_name, outputfilename)
- #
- # hack hack hack: copy all *bound methods* from module.ffi back to the
- # ffi instance. Then calls like ffi.new() will invoke module.ffi.new().
- for name in dir(module.ffi):
- if not name.startswith('_'):
- attr = getattr(module.ffi, name)
- if attr is not getattr(ffi, name, object()):
- setattr(ffi, name, attr)
- def typeof_disabled(*args, **kwds):
- raise NotImplementedError
- ffi._typeof = typeof_disabled
- for name in dir(ffi):
- if not name.startswith('_') and not hasattr(module.ffi, name):
- setattr(ffi, name, NotImplemented)
- return module.lib