How to get Python scripts to fail quietly?

I have just written my first Python script for Hazel (an external script used in an action).
This works quite well, except for one thing:
Every time the script returns with "1" because it's preconditions are not met, Hazel shows a "Script failed..." notification.
I have tried both "sys.exit(1)" and "exit (1)", but the result remains the same.
In contrast, a bash script that is quit with "exit 1" does not produce such a notification.
Is there anything special that I have to do?
Thanks!
This works quite well, except for one thing:
Every time the script returns with "1" because it's preconditions are not met, Hazel shows a "Script failed..." notification.
I have tried both "sys.exit(1)" and "exit (1)", but the result remains the same.
In contrast, a bash script that is quit with "exit 1" does not produce such a notification.
Is there anything special that I have to do?
Thanks!