From 0c2f9b06a9063fd396f76496a4cf28a065e77b61 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Sat, 24 Oct 2009 15:01:29 -0400 Subject: [PATCH] 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). --- Demos/freeze/cmath.pyx | 2 +- Demos/freeze/combinatorics.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- 2.26.2