Author: Ronan Lamy <ronan.l...@gmail.com> Branch: Changeset: r82074:e5eb901ac085 Date: 2016-02-04 16:33 +0000 http://bitbucket.org/pypy/pypy/changeset/e5eb901ac085/
Log: Handle pdb.set_trace() in rpython/annotator/builtin.py diff --git a/rpython/annotator/builtin.py b/rpython/annotator/builtin.py --- a/rpython/annotator/builtin.py +++ b/rpython/annotator/builtin.py @@ -311,3 +311,14 @@ @analyzer_for(rpython.rlib.objectmodel.free_non_gc_object) def robjmodel_free_non_gc_object(obj): pass + +#________________________________ +# pdb + +import pdb + +@analyzer_for(pdb.set_trace) +def pdb_set_trace(*args_s): + raise AnnotatorError( + "you left pdb.set_trace() in your interpreter! " + "If you want to attach a gdb instead, call rlib.debug.attach_gdb()") diff --git a/rpython/rtyper/extfuncregistry.py b/rpython/rtyper/extfuncregistry.py --- a/rpython/rtyper/extfuncregistry.py +++ b/rpython/rtyper/extfuncregistry.py @@ -11,7 +11,6 @@ import math from rpython.rtyper.lltypesystem.module import ll_math -from rpython.rtyper.module import ll_pdb from rpython.rlib import rfloat # the following functions all take one float, return one float diff --git a/rpython/rtyper/module/ll_pdb.py b/rpython/rtyper/module/ll_pdb.py deleted file mode 100644 --- a/rpython/rtyper/module/ll_pdb.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -Complain if you leave in pdb.set_trace() in the code -""" - -import pdb -from rpython.rtyper.extfunc import ExtFuncEntry - - -class FunEntry(ExtFuncEntry): - _about_ = pdb.set_trace - def compute_result_annotation(self, *args_s): - raise Exception("you left pdb.set_trace() in your interpreter!" - "If you want to attach a gdb instead, call rlib.debug.attach_gdb()") _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit