X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=remote_worker.py;h=0086c40b0379ce680383c3b4e723bdc92b3bec0a;hb=f2c7c1a131d8846c15613125b6ed999724f0ab2f;hp=c04ac652449c5cb0e926ac35cc8fbaed7b05d7c4;hpb=b29be4f1750fd20bd2eada88e751dfae85817882;p=python_utils.git diff --git a/remote_worker.py b/remote_worker.py index c04ac65..0086c40 100755 --- a/remote_worker.py +++ b/remote_worker.py @@ -83,6 +83,7 @@ def main() -> None: in_file = config.config['code_file'] out_file = config.config['result_file'] + stop_thread = None if config.config['watch_for_cancel']: (thread, stop_thread) = watch_for_cancel() @@ -130,8 +131,9 @@ def main() -> None: 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__':