I know, I could workaround it with a different type, but I hope the question could be interesting anyhow...
def try_me:
try:
do_something()
return 0 # can it be confused with an error?
except some_external_module.defined_exception as e:
return e.errno
except:
return -1
In other words, is there any rule or convention that says err numbers shall be strictly positive?