Jan-Philip Gehrcke added the comment:

> Regarding the documentation patch: I like to start sentences
> with a capital letter. Perhaps change it to start
> “Calling :func:`exit` only terminates . . .”.

Thanks for feedback. Have now used "Invocation of ...." to not repeat "call*" 
in the sentence, because I left the "when called from the main thread" part 
unchanged. Okay?

> With the code change patch, it might be neater to use
> the SystemExit.code attribute rather than e.args[0].

Oh, thanks. Was not aware of the existence of the `code` attribute. If anyone 
else was wondering: existence and behavior are defined in Objects/exceptions.c 
via `static PyMemberDef SystemExit_members[]` and via `static int 
SystemExit_init()`.

It is populated upon construction of a SystemExit instance:

Py_CLEAR(self->code);
if (size == 1)
    self->code = PyTuple_GET_ITEM(args, 0);
else /* size > 1 */
    self->code = args;
    
Hence, the translation from arguments to exit code considers *all* arguments. I 
adjusted the patch to use the `code` attribute.

----------
Added file: http://bugs.python.org/file37989/issue6634_py35.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6634>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to