From: Mark Lodato Date: Sat, 24 Oct 2009 19:01:29 +0000 (-0400) Subject: freeze: exit(2) in examples, to test exit code X-Git-Tag: 0.12.alpha0~11^2~2^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c2f9b06a9063fd396f76496a4cf28a065e77b61;p=cython.git 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). --- diff --git a/Demos/freeze/cmath.pyx b/Demos/freeze/cmath.pyx index d94bb1f2..f613dfe6 100644 --- a/Demos/freeze/cmath.pyx +++ b/Demos/freeze/cmath.pyx @@ -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) diff --git a/Demos/freeze/combinatorics.pyx b/Demos/freeze/combinatorics.pyx index f3a23ece..248a7a50 100644 --- a/Demos/freeze/combinatorics.pyx +++ b/Demos/freeze/combinatorics.pyx @@ -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)