From 1489b81fee3f9d2dd0873c76d7e13beda9a0fd73 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 6 May 2016 17:30:34 +0530 Subject: [PATCH] diagnostics: Fix a warning about a global use --- plinth/modules/diagnostics/diagnostics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/modules/diagnostics/diagnostics.py b/plinth/modules/diagnostics/diagnostics.py index a44539afe..7aa4ed4a6 100644 --- a/plinth/modules/diagnostics/diagnostics.py +++ b/plinth/modules/diagnostics/diagnostics.py @@ -70,10 +70,10 @@ def module(request, module_name): def _start_task(): """Start the run task in a separate thread.""" + global _running_task if _running_task: raise Exception('Task already running') - global _running_task _running_task = threading.Thread(target=_run_on_all_modules_wrapper) _running_task.start()