title: sys.excepthook is not called when debugging under PyCharm
body: <p>I have my own custom sys.excepthook to handle errors (via a custom error message) and it runs fine when run directly.
  Since updating PyCharm to version 2019.3 this function it does not work when debugging. Used to work in older versions.
  Instead, PyCharm just prints the stack and terminates the process.</p>
  
  <p>Here's a basic code. Works when run directly but fails when debugged.</p>
  
  <pre><code>import sys
  def myExceptHook(type, value, tb):
      print("there's been an error")
  
  # reroute every exception through my hook
  sys.excepthook = myExceptHook
  raise Exception('error')
  </code></pre>
  
  <p>When debugging I get the following output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1434, in _exec
      pydev_imports.execfile(file, globals, locals)  # execute the script
    File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
      exec(compile(contents+"\n", file, 'exec'), glob, loc)
    File "C:/Projects/TubeEye/code/testraise.py", line 8, in &lt;module&gt;
      raise Exception('error')
  Exception: error
  </code></pre>
  
  <p>But if running directly I get (as expected):</p>
  
  <pre><code>there's been an error
  </code></pre>