On Thu, May 1, 2014 at 8:17 PM, Salvatore Orlando <sorla...@nicira.com>wrote:
> The patch you've been looking at just changes the way in which SystemExit > is used, it does not replace it with sys.exit. > In my experience sys.exit was causing unit test threads to interrupt > abruptly, whereas SystemExit was being caught by the test runner and > handled. > According to https://docs.python.org/2.7/library/sys.html#sys.exit , sys.exit(n) is an equivalent for raise SystemExit(n), it can be confirmed in the source code here: http://hg.python.org/cpython/file/2.7/Python/sysmodule.c#l206 If there's any difference in behavior it seems to be the problem of test runner. For example, it can mock sys.exit somehow. I find therefore a bit strange that you're reporting what appears to be > the opposite behaviour. > > Maybe if you could share the code you're working on we can have a look at > it and see what's going on. > I'd suggest finding out what's the difference in both of your cases. Coming back to topic, I'd prefer using standard library call because it can be mocked for testing. -- Kind regards, Yuriy.
_______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev