Skip to content

Fix exit bugs of multiple python scripts #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/scripts/ns-html2rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ns-html2rst - Convert Cocoa HTML documentation into ReST

usage: nshtml2rst < NSString.html > NSString.rst
"""
exit(0)
sys.exit(0)

html = sys.stdin.read()

Expand Down
3 changes: 2 additions & 1 deletion test/Driver/Dependencies/Inputs/fail.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python

exit(1)
import sys
sys.exit(1)
2 changes: 1 addition & 1 deletion test/Driver/Dependencies/Inputs/update-dependencies-bad.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if os.path.basename(primaryFile) == 'bad.swift':
print "Handled", os.path.basename(primaryFile)
exit(1)
sys.exit(1)

dir = os.path.dirname(os.path.abspath(__file__))
execfile(os.path.join(dir, "update-dependencies.py"))
2 changes: 1 addition & 1 deletion utils/cmpcodesize
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def main():
if not oldBuildDir:
sys.exit("$SWIFT_OLD_BUILDDIR not specified")
if not newBuildDir:
die("$SWIFT_NEW_BUILDDIR not specified")
sys.exit("$SWIFT_NEW_BUILDDIR not specified")
oldFileArgs = [ "O", "Ounchecked", "Onone", "dylib" ]
oldFiles = []
newFiles = []
Expand Down
3 changes: 2 additions & 1 deletion utils/gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ def succ(a):
if args.test or args.verbose_test:
import doctest
if doctest.testmod(verbose=args.verbose_test).failed:
exit(1)
import sys
sys.exit(1)

bindings = dict( x.split('=', 1) for x in args.defines )
ast = parseTemplate(args.file.name, args.file.read())
Expand Down
2 changes: 1 addition & 1 deletion utils/submit-benchmark-results
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def capture_with_result(args, include_stderr=False):
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
except OSError,e:
if e.errno == errno.ENOENT:
fatal('no such file or directory: %r when running %s.' % (
sys.exit('no such file or directory: %r when running %s.' % (
args[0], ' '.join(args)))
raise
out,_ = p.communicate()
Expand Down