-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure verify terminates on model validation failure #352
Conversation
02e86cf
to
b914c4d
Compare
Signed-off-by: Janine Olear <[email protected]>
b914c4d
to
cc3f10f
Compare
I think we should not use Also, the We should most likely use Consider this test program: import atexit
import os
import sys
class C:
def __del__(self):
print("Destructor called")
def test_exit():
exit(-1)
def test_sys_exit():
sys.exit(-1)
def test_os__exit():
os._exit(-1)
def bye():
print("bye...")
c = C()
atexit.register(bye)
args = sys.argv[1:]
if len(args) == 1:
what = args[0]
if what == "exit": test_exit()
if what == "sys.exit": test_sys_exit()
if what == "os._exit": test_os__exit()
print("Nothing matched")
print("Ended successfully") Running it with [...]$ python -S test.py exit; echo $?
Traceback (most recent call last):
File "/tmp/test.py", line 27, in <module>
if what == "exit": test_exit()
^^^^^^^^^^^
File "/tmp/test.py", line 10, in test_exit
exit(-1)
^^^^
NameError: name 'exit' is not defined. Did you mean: 'atexit'?
bye...
Destructor called
1
[...]$ python -S test.py sys.exit; echo $?
bye...
Destructor called
255
[...]$ python -S test.py os._exit; echo $?
255 Only It seems at the selected version ( |
Unrelated, but should this be
If so, I'd like to request all the |
Oh, right, that's a good point. |
Signed-off-by: Janine Olear <[email protected]>
9f9f2c3
to
9f92044
Compare
Oh sry, I didn't see the updates. Yes, that makes sense and I changed it now back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Just added some suggested edits to always include the error code. Thank you
Signed-off-by: Mihai Maruseac <[email protected]>
Signed-off-by: Mihai Maruseac <[email protected]>
Signed-off-by: Mihai Maruseac <[email protected]>
Summary
Ensure verify terminates on model validation failure.
Closes #351
Release Note
fix: ensure verify terminates on model validation failure
Documentation
Now it seems to work as expected :)