This is an archive of the discontinued LLVM Phabricator instance.

Fix use of undefined session variable
ClosedPublic

Authored by thopre on Jan 15 2021, 3:53 PM.

Details

Summary

Commit eb0f1b51e7bcf46cf8868ea0186f8e8f086e6ed8 introduced uses of
variable session in lnt/server/reporting/summaryreport.py but one of
them is in function _build_data_table() which does not have a session
parameter. This commit adds the parameter and update call sites
accordingly, fixing one of Flake8's F821 warning (undefined name).

Event Timeline

thopre created this revision.Jan 15 2021, 3:53 PM
thopre requested review of this revision.Jan 15 2021, 3:53 PM
thopre edited the summary of this revision. (Show Details)Jan 16 2021, 6:23 AM
thopre added reviewers: tnfchris, danilaml, cmatthews.

This commit adds the parameter and update call sites
accordingly, fixing one of Flake8's F821 warning (undefined name).

Sorry I'm not very well versed in Flake8, but why does this fix this specific warning? session isn't used so just wondering how it suppresses undefined name.

thopre added inline comments.Jan 16 2021, 10:55 AM
lnt/server/reporting/summaryreport.py
344

@tnfchris This existing use of session is "undefined name" for Flake8 because session is not defined in that context. This patch adds the session parameter to the method this code is part of, thereby making session no longer undefined.

tnfchris accepted this revision.Jan 16 2021, 11:20 AM

Aha thanks for the explanation

This revision is now accepted and ready to land.Jan 16 2021, 11:20 AM
thopre closed this revision.Jan 16 2021, 12:23 PM