Skip to content

Commit 0b70e6e

Browse files
committed
Fix exit bugs of some python scripts
1 parent 1c5ffe6 commit 0b70e6e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

docs/scripts/ns-html2rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ns-html2rst - Convert Cocoa HTML documentation into ReST
1010
1111
usage: nshtml2rst < NSString.html > NSString.rst
1212
""")
13-
exit(0)
13+
sys.exit(0)
1414

1515
html = sys.stdin.read()
1616

test/Driver/Dependencies/Inputs/fail.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
# See http://swift.org/LICENSE.txt for license information
1010
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12-
exit(1)
12+
import sys
13+
sys.exit(1)

test/Driver/Dependencies/Inputs/update-dependencies-bad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
if os.path.basename(primaryFile) == 'bad.swift':
2929
print("Handled", os.path.basename(primaryFile))
30-
exit(1)
30+
sys.exit(1)
3131

3232
dir = os.path.dirname(os.path.abspath(__file__))
3333
execfile(os.path.join(dir, "update-dependencies.py"))

utils/gyb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ def succ(a):
10581058
if args.test or args.verbose_test:
10591059
import doctest
10601060
if doctest.testmod(verbose=args.verbose_test).failed:
1061-
exit(1)
1061+
sys.exit(1)
10621062

10631063
bindings = dict( x.split('=', 1) for x in args.defines )
10641064
ast = parseTemplate(args.file.name, args.file.read())

0 commit comments

Comments
 (0)