in_file = config.config['code_file']
out_file = config.config['result_file']
- (thread, stop_thread) = watch_for_cancel()
+ stop_thread = None
+ if config.config['watch_for_cancel']:
+ (thread, stop_thread) = watch_for_cancel()
logger.debug(f'Reading {in_file}.')
try:
stop_thread.set()
sys.exit(-1)
- stop_thread.set()
- thread.join()
+ if stop_thread is not None:
+ stop_thread.set()
+ thread.join()
if __name__ == '__main__':