Author: Antonio Cuni <[email protected]>
Branch: resource_warning
Changeset: r83579:e1647e262594
Date: 2016-04-07 21:54 +0000
http://bitbucket.org/pypy/pypy/changeset/e1647e262594/

Log:    don't crash if we enable track_resources at the early startup (in
        particular, if we pass the -X track-resources option). It is a bit
        impossible to write an app-level test for it because we always have
        a bottom frame in that case

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1763,7 +1763,12 @@
                 import sys, traceback
                 # the "1" is because we don't want to show THIS code
                 # object in the traceback
-                f = sys._getframe(1)
+                try:
+                    f = sys._getframe(1)
+                except ValueError:
+                    # this happens if you call format_traceback at the very 
beginning
+                    # of startup, when there is no bottom code object
+                    return '<no stacktrace available>'
                 return "".join(traceback.format_stack(f))
             """)
         finally:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to