[pypy-svn] r49942 - pypy/dist/pypy/translator/jvm

antocuni at codespeak.net antocuni at codespeak.net
Wed Dec 19 19:16:19 CET 2007


Author: antocuni
Date: Wed Dec 19 19:16:18 2007
New Revision: 49942

Modified:
   pypy/dist/pypy/translator/jvm/generator.py
Log:
dump the state of the program in case jtype is None; this should help
to fix the inconsistently failing test_weakref_simple



Modified: pypy/dist/pypy/translator/jvm/generator.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/generator.py	(original)
+++ pypy/dist/pypy/translator/jvm/generator.py	Wed Dec 19 19:16:18 2007
@@ -1,3 +1,9 @@
+try:
+    import pycrash
+    mypycrash = pycrash.PyCrash({'AppName': 'genjvm'})
+except ImportError:
+    mypycrash = None
+
 from pypy.objspace.flow import model as flowmodel
 from pypy.translator.oosupport.metavm import Generator
 from pypy.translator.oosupport.treebuilder import SubOperation
@@ -1379,6 +1385,13 @@
             '.implements ' + jinterface.descriptor.int_class_name() + '\n')
         
     def add_field(self, fobj):
+        try:
+            fobj.jtype.descriptor
+        except AttributeError:
+            if mypycrash is not None:
+                mypycrash.forceDump()
+                mypycrash.saveToFile("/tmp/test_jvm_weakref.pycrash")
+
         kw = ['public']
         if fobj.is_static: kw.append('static')
         self.curclass.out('.field %s %s %s\n' % (


More information about the pypy-svn mailing list