问题描述: 自定义了一个异常类, 但是抛出该异常时前面总有个__main__ 自定义的异常类: class NoOutputError(Exception): """description.""" def __str__(self): return "Current target has no outputs" 主动抛出该异常 raise NoOutputError 显示的结果中有个__main__, 想着去掉