Alistair Coles 43c1141baa Fix race in shell when testing for errors to raise SysExit
SysExit is raised if the OutputManager has non-zero
error_count. However, error_count is incremented in
a print thread, but tested on the main thread.
Currently error_count is tested before the OutputManager
print threads have exited, which results in a race. This race
means that SysExit is not always raised even when an error
has occured.

This change moves the error_count test after the
OutputManager context manager has exited, which ensures that
the OutputManager threads have exited.

Change-Id: I5ef7d9f10057fe2b41f48ab95066a7265b86a3ac
Closes-Bug: #1379229
2014-10-20 08:58:19 +01:00
..
2014-05-26 14:35:03 +02:00
2014-10-17 13:38:01 -06:00
2014-07-11 13:05:22 -07:00