def exit_sab(value):
 sys.stderr.flush()
 sys.stdout.flush()
 if (getattr(sys, 'frozen', None) == 'macosx_app'):
  sabnzbd.SABSTOP = True
  from PyObjCTools import AppHelper
  AppHelper.stopEventLoop()
 sys.exit(value)

def exit_sab ( value ) : sys . stderr . flush ( ) sys . stdout . flush ( ) if ( getattr ( sys , 'frozen' , None ) == 'macosx_app' ) : sabnzbd . SABSTOP = True from PyObjCTools import AppHelper AppHelper . stopEventLoop ( ) sys . exit ( value )
leave the program after flushing stderr/stdout .