i don't think a library function should call `sys.exit`. if a library ends up in a state where it cannot possibly continue, it should raise an exception. a _command line program_ could then choose to catch such exceptions and decide to exit