Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyDev debugging: do not open "_pydev_execfile" at the end

I am new to both Python and Eclipse.

I am debugging a module file with Eclipse/PyDev. When I click "Step over" or "Step return" at the last line of the file, Eclipse opens the file "_pydev_execfile" where I have to click "Step over" or "Step return" again, before the debugging is terminated.

Does this occur for everyone or just me?

Can I avoid this?

like image 300
Bananach Avatar asked Aug 15 '16 12:08

Bananach


1 Answers

In general, you can put # @DontTrace at the end of lines that define functions to ignore these functions in the traceback.

In the particular case described in the question, this works as follows: Change the definition of execfile() in _pydev_execfile.py to:

def execfile(file, glob=None, loc=None):  # @DontTrace
    ...

Afterwards, PyDev ends up opening another file (codecs.py) at the end of debugging. To fix this, you will have to @DontTrace a few more functions in that (but only in that one) file.

like image 199
Bananach Avatar answered Nov 05 '22 20:11

Bananach