Where is `option_parser` defined? If you need to raise an error from the option_parser, that means that some code is misplaces and it should be on the script, rather than on the module.