Init process variable
authorThierry Florac <thierry.florac@onf.fr>
Thu, 08 Oct 2015 11:12:35 +0200
changeset 21 8b3250991530
parent 20 5f69e8334fa3
child 22 b1a1ccc1fa26
Init process variable
src/pyams_scheduler/include.py
--- a/src/pyams_scheduler/include.py	Thu Aug 27 11:43:05 2015 +0200
+++ b/src/pyams_scheduler/include.py	Thu Oct 08 11:12:35 2015 +0200
@@ -60,6 +60,7 @@
         # get application
         application_name = settings.get(PYAMS_APPLICATION_SETTINGS_KEY, PYAMS_APPLICATION_DEFAULT_NAME)
         application = root.get(application_name)
+        process = None
         if application is not None:
             sm = application.getSiteManager()
             set_local_registry(sm)
@@ -89,7 +90,7 @@
                         if process.is_alive():
                             atexit.register(process_exit_func, process=process)
             finally:
-                if not process.is_alive():
+                if process and not process.is_alive():
                     process.terminate()
                     process.join()
                 set_local_registry(None)