Bananach
Bananach

Reputation: 2311

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?

Upvotes: 9

Views: 1426

Answers (2)

extractor
extractor

Reputation: 37

in my case , I faced it when there was an error in the code. please look for syntax errors , a missing bracket or an additional bracket or a missing colon etc. Once I fixed it, I was able to debug fine.

Upvotes: -1

Bananach
Bananach

Reputation: 2311

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.

Upvotes: 2

Related Questions