Author: Armin Rigo <[email protected]>
Branch: reverse-debugger
Changeset: r94655:40fff8a8e2e0
Date: 2018-05-23 19:26 +0200
http://bitbucket.org/pypy/pypy/changeset/40fff8a8e2e0/
Log: Explain and tweak
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -83,17 +83,24 @@
sys.excepthook(), catching SystemExit, printing a newline after
sys.stdout if needed, etc.
"""
+ # don't use try:except: here, otherwise the exception remains
+ # visible in user code. Make sure revdb_stop is a callable, so
+ # that we can call it immediately after finally: below. Doing
+ # so minimizes the number of "blind" lines that we need to go
+ # back from, with "bstep", after we do "continue" in revdb.
if '__pypy__' in sys.builtin_module_names:
from __pypy__ import revdb_stop
else:
revdb_stop = None
+ if revdb_stop is None:
+ revdb_stop = lambda: None
+
try:
# run it
try:
f(*fargs, **fkwds)
finally:
- if revdb_stop:
- revdb_stop()
+ revdb_stop()
sys.settrace(None)
sys.setprofile(None)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit