mirror of https://github.com/KLayout/klayout.git
Merge remote-tracking branch 'upstream/issue-1565' into 0.28.14-mac1
This commit is contained in:
commit
0e1706cdbb
|
|
@ -119,7 +119,9 @@ void check_error ()
|
||||||
int status = 0;
|
int status = 0;
|
||||||
if (exc_value) {
|
if (exc_value) {
|
||||||
tl::Variant st = python2c<tl::Variant> (exc_value.get ());
|
tl::Variant st = python2c<tl::Variant> (exc_value.get ());
|
||||||
status = st.to_int ();
|
if (st.can_convert_to_int ()) {
|
||||||
|
status = st.to_int ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw tl::ExitException (status);
|
throw tl::ExitException (status);
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,14 @@ class KLayoutMain_TestClass < TestBase
|
||||||
out = `#{self.klayout_bin} -z -r #{File.join(File.dirname(__FILE__), "test12.rb")} 2>&1`
|
out = `#{self.klayout_bin} -z -r #{File.join(File.dirname(__FILE__), "test12.rb")} 2>&1`
|
||||||
assert_equal(out, "Before exit()\n")
|
assert_equal(out, "Before exit()\n")
|
||||||
|
|
||||||
|
# sys.exit(0) - Python
|
||||||
|
out = `#{self.klayout_bin} -z -r #{File.join(File.dirname(__FILE__), "test12s.py")} 2>&1`
|
||||||
|
assert_equal(out, "Before exit()\n")
|
||||||
|
|
||||||
|
# quit() - Python (issue #1565)
|
||||||
|
out = `#{self.klayout_bin} -z -r #{File.join(File.dirname(__FILE__), "test12q.py")} 2>&1`
|
||||||
|
assert_equal(out, "Before quit()\n")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
print("Before quit()")
|
||||||
|
quit()
|
||||||
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("Before exit()")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
Loading…
Reference in New Issue