diff options
author | Ronan Lamy <ronan.lamy@gmail.com> | 2018-11-27 18:40:23 +0000 |
---|---|---|
committer | Ronan Lamy <ronan.lamy@gmail.com> | 2018-11-27 18:40:23 +0000 |
commit | ee96fd83fe5883ac5b5f7880cfbc959f9bf90b4b (patch) | |
tree | de4c55110830c51df6b539aa61e9879f557c5f5d /cffi/recompiler.py | |
parent | 9178ac12a645f71749b273cc630d41b98001ad6a (diff) | |
download | cffi-ee96fd83fe5883ac5b5f7880cfbc959f9bf90b4b.tar.gz |
Move test-only function from cffi/ to testing/
Diffstat (limited to 'cffi/recompiler.py')
-rw-r--r-- | cffi/recompiler.py | 24 |
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 |