<div dir="ltr"><div class="gmail_extra">On Thu, May 1, 2014 at 8:17 PM, Salvatore Orlando <span dir="ltr"><<a href="mailto:sorlando@nicira.com" target="_blank">sorlando@nicira.com</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">The patch you've been looking at just changes the way in which SystemExit is used, it does not replace it with sys.exit.<div>
In my experience sys.exit was causing unit test threads to interrupt abruptly, whereas SystemExit was being caught by the test runner and handled.</div></div></blockquote><div><br></div><div style>According to <a href="https://docs.python.org/2.7/library/sys.html#sys.exit">https://docs.python.org/2.7/library/sys.html#sys.exit</a> , sys.exit(n) is an equivalent for raise SystemExit(n), it can be confirmed in the source code here: <a href="http://hg.python.org/cpython/file/2.7/Python/sysmodule.c#l206">http://hg.python.org/cpython/file/2.7/Python/sysmodule.c#l206</a></div>
<div style>If there's any difference in behavior it seems to be the problem of test runner. For example, it can mock sys.exit somehow.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div>I find therefore a bit strange that you're reporting what appears to be the opposite behaviour.</div><div><br></div><div>Maybe if you could share the code you're working on we can have a look at it and see what's going on.</div>
</div></blockquote><div><br></div><div>I'd suggest finding out what's the difference in both of your cases.</div></div><div class="gmail_extra"><br></div>Coming back to topic, I'd prefer using standard library call because it can be mocked for testing.<br clear="all">
<div><br></div>-- <br><br><div>Kind regards, Yuriy.</div>
</div></div>