Search code examples
pythoneclipsedebuggingpydev

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?


Solution

  • 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.