Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
signal.signal(signal.SIGQUIT, self.__signal_handler)
signal.siginterrupt(signal.SIGQUIT, False)
signal.signal(signal.SIGTERM, self.__signal_handler)
signal.siginterrupt(signal.SIGTERM, False)
signal.siginterrupt(signal.SIGPIPE, False)
locale.setlocale(locale.LC_ALL, "")
languages, use_opensubtitles, paths, recursive = self.__get_cmd_options()
tools = Tv_show_tools(use_opensubtitles)
errors = tools.get_subtitles(paths, languages, recursive)
except (End_work_exception, Fatal_error) as e:
E(e)
except BaseException as e:
if not isinstance(e, SystemExit):
E("pysd crashed: {0}.", e)
else:
sys.exit(1 if errors else 0)
sys.exit(1)
def __signal_handler(self, signum, frame):
"""Handler for the UNIX signals."""
raise End_work_exception()