Author: Jeremy Thurgood <fir...@gmail.com>
Branch: split-verify
Changeset: r1358:1e40024fb288
Date: 2013-10-06 18:09 +0200
http://bitbucket.org/cffi/cffi/changeset/1e40024fb288/

Log:    I think this is the most horrible thing I have written in months,
        but... pickle all the _declarations.

diff --git a/cffi/builder.py b/cffi/builder.py
--- a/cffi/builder.py
+++ b/cffi/builder.py
@@ -1,3 +1,5 @@
+import pickle
+
 from .api import FFI
 
 
@@ -6,7 +8,7 @@
 ##### NOTE: This module is generated by cffi. DO NOT EDIT IT MANUALLY. #####
 #####                                                                  #####
 
-from functools import wraps
+import pickle
 from cffi import FFI
 
 
@@ -74,8 +76,6 @@
 
     def cdef(self, csource, override=False):
         self.ffi.cdef(csource, override=override)
-        self._module_source += "_ffi.cdef(%r, override=%r)\n" % (
-            csource, override)
 
     def add_dlopen(self, libname, name, flags=0):
         lib = self.ffi.dlopen(name, flags=flags)
@@ -97,6 +97,9 @@
         self._built_files.append(libfilename + _get_so_suffix())
 
     def write_ffi_module(self):
+        self._module_source += (
+            "_ffi._parser._declarations = pickle.loads(%r)" %
+            pickle.dumps(self.ffi._parser._declarations, 2))
         import os
         try:
             os.makedirs(self._module_path)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to