[pypy-commit] pypy default: Fix: always use self.bookkeeper, instead of sometimes having it and sometimes not.

arigo noreply at buildbot.pypy.org
Sun Feb 5 13:20:45 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r52109:68cacc899ee9
Date: 2012-02-05 12:20 +0000
http://bitbucket.org/pypy/pypy/changeset/68cacc899ee9/

Log:	Fix: always use self.bookkeeper, instead of sometimes having it and
	sometimes not. This is needed to translate pypy.

diff --git a/pypy/rpython/extfunc.py b/pypy/rpython/extfunc.py
--- a/pypy/rpython/extfunc.py
+++ b/pypy/rpython/extfunc.py
@@ -153,11 +153,10 @@
                "Argument number mismatch"
 
         check_no_nul = False
-        if hasattr(self, 'bookkeeper'):
-            config = self.bookkeeper.annotator.translator.config
-            if config.translation.check_str_without_nul:
-                check_no_nul = True
-            
+        config = self.bookkeeper.annotator.translator.config
+        if config.translation.check_str_without_nul:
+            check_no_nul = True
+
         for i, expected in enumerate(signature_args):
             if not check_no_nul:
                 expected = annmodel.remove_no_nul(expected)
@@ -181,6 +180,7 @@
 
     def specialize_call(self, hop):
         rtyper = hop.rtyper
+        self.bookkeeper = rtyper.annotator.bookkeeper
         signature_args = self.normalize_args(*hop.args_s)
         args_r = [rtyper.getrepr(s_arg) for s_arg in signature_args]
         args_ll = [r_arg.lowleveltype for r_arg in args_r]


More information about the pypy-commit mailing list