Author: Ronan Lamy <[email protected]>
Branch: 
Changeset: r74542:d8042a6b7573
Date: 2014-11-16 20:38 +0000
http://bitbucket.org/pypy/pypy/changeset/d8042a6b7573/

Log:    Call the expensive check_no_flags() only in tests

diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -223,6 +223,9 @@
                 self.setbinding(v, annmodel.s_ImpossibleValue)
         # policy-dependent computation
         self.bookkeeper.compute_at_fixpoint()
+
+    def validate(self):
+        """Check that the annotation results are valid"""
         self.bookkeeper.check_no_flags_on_instances()
 
     def annotation(self, arg):
diff --git a/rpython/annotator/test/test_annrpython.py 
b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -48,6 +48,7 @@
     class RPythonAnnotator(_RPythonAnnotator):
         def build_types(self, *args):
             s = _RPythonAnnotator.build_types(self, *args)
+            self.validate()
             if option.view:
                 self.translator.view()
             return s
diff --git a/rpython/rtyper/test/test_llinterp.py 
b/rpython/rtyper/test/test_llinterp.py
--- a/rpython/rtyper/test/test_llinterp.py
+++ b/rpython/rtyper/test/test_llinterp.py
@@ -41,6 +41,7 @@
     t.config.set(**extraconfigopts)
     a = t.buildannotator(policy=policy)
     timelog("annotating", a.build_types, func, argtypes, main_entry_point=True)
+    a.validate()
     if viewbefore == 'auto':
         viewbefore = getattr(option, 'view', False)
     if viewbefore:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to