Brian Sutherland added the comment:
On Wed, Oct 28, 2015 at 03:32:36PM +, Guido van Rossum wrote:
>
> Guido van Rossum added the comment:
>
> How about we extend loop.stop() so that you can pass it an exception to
> raise once the loop is stopped? This exception would then b
Brian Sutherland added the comment:
On Wed, Oct 28, 2015 at 02:49:55PM +, R. David Murray wrote:
>
> R. David Murray added the comment:
>
> Using sys.exit means you are depending on garbage collection to clean
> up all of your program's resources. In the general case
Brian Sutherland added the comment:
Calling loop.stop() means that I need other, more complex code, to store and
return the non-zero exit status.
--
___
Python tracker
<http://bugs.python.org/issue25
Brian Sutherland added the comment:
the workaround I am using at the moment is this:
def handler(loop, context):
print('Got error, exiting')
loop.call_soon(sys.exit, 42)
which actually does cause the process to exit
--
___
Pyth
New submission from Brian Sutherland:
Running the attached file with python3 shows that SystemExit is caught rather
than causing the process to stop. That's quite surprising.
--
components: asyncio
files: test_sys_exit_in_exception_handler.py
messages: 253529
nosy: gvanrossum,
New submission from Brian Sutherland:
When running Python inside PostgreSQL using plpython on OSX 10.7.5 I started
coming across very strange and apparently random ImportErrors. For example,
failing to find the stat module while importing site:
Traceback (most recent call last