In PyCharm when an Error occurs the IDE opens the module that produced the Error (this is especially annoying when the Error was produced by pressing Ctrl+C).
It also opens the module in which the program currently "is" when pausing in Debug mode. Is there a way to disable this behavior for built-in modules? (Preferably with a way of showing the exception anyway in case you want to see the source of the built-in module)
I accept the bounty as it pointed to the right direction:
applying the same trick to the file pydevd.py line 1793 finally solved it for me!!
try:
launch(file, globals, locals) # execute the script
except:
import traceback; traceback.print_exc()
As I posted later here you can Edit PyDev's source to prevent parts of this from happening:
First, you have to find the source for the PyDev interactive interpreter (which is used by PyCharm). On my Windows machine it is located in C:\Program Files (x86)\PyCharm\helpers\PyDev
(path my vary of course).
The problem can be fixed by editing the file _pydev_imps/_pydev_execfile.py
(in the PyDev source directory). Line 18 reads
exec(compile(contents+"\n", file, 'exec'), glob, loc)
wrap it in a try ... except
block with the following code as exception handler
import traceback; traceback.print_exc()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With