Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(travis): interrupt the built at the first error message
- Loading branch information
1 parent
088f753
commit d3290ec
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
import sys | ||
|
||
try: | ||
for line in sys.stdin: | ||
sys.stdout.write(line) | ||
if 'error' in line: raise sys.exit() | ||
This comment has been minimized.
Sorry, something went wrong. |
||
except: | ||
try: | ||
for i in range(20): | ||
line = sys.stdin.next() | ||
if not line: break | ||
sys.stdout.write(line) | ||
finally: | ||
sys.exit(-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This
raise sys.exit()
is confusing.sys.exit()
already works by raising an exception, so it's like writingraise (raise SystemExit)
(if that was valid syntax, which it's not).I think you actually don't need any
try
/except
to do this, just delete all those lines and theraise sys.exit()
and fix the block structure.