Commit 0c2f9b06 authored by Mark Lodato's avatar Mark Lodato

freeze: exit(2) in examples, to test exit code

The cython_freeze-generated executable exits with code 1 if something
wrong happens, unless a SystemExit exception occurred, in which case it
returns the value passed to sys.exit().  In order to differentiate
between the two cases, change the two example Cython modules to exit(2).
parent 41e31056
......@@ -19,6 +19,6 @@ if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
sys.stderr.write("USAGE: %s n\nPrints n!.\n" % sys.argv[0])
sys.exit(1)
sys.exit(2)
n, = map(float, sys.argv[1:])
print factorial(n)
......@@ -9,6 +9,6 @@ if __name__ == "__main__":
import sys
if len(sys.argv) != 3:
sys.stderr.write("USAGE: %s n r\nPrints n-choose-r.\n" % sys.argv[0])
sys.exit(1)
sys.exit(2)
n, r = map(float, sys.argv[1:])
print nCr(n, r)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment