From 28a33c6fed1a6150e63c2ecd7d5acb53f2ecf96a Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Fri, 7 Jun 2019 18:18:20 +0100 Subject: [PATCH] lisa.analysis.tasks: Fix TaskAnalysis.plot_task_activation() Add nonlocal declaration since the variable is assigned to in a closure, while refering to a name bound in an outer scope. --- lisa/analysis/tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisa/analysis/tasks.py b/lisa/analysis/tasks.py index bb2630cf8..18006a5e4 100644 --- a/lisa/analysis/tasks.py +++ b/lisa/analysis/tasks.py @@ -779,6 +779,8 @@ class TasksAnalysis(TraceAnalysisBase): """ def plotter(axis, local_fig): + nonlocal active_value, sleep_value + # Adapt the steps height to the existing limits. This allows # re-using an existing axis that already contains some data. min_lim, max_lim = axis.get_ylim() -- GitLab