# HG changeset patch # User Pierre-Yves David # Date 2019-08-08 09:06:13 # Node ID 978c9a0c5974a6049c639b4b2c712978af034455 # Parent bac24a8a095a92b96df95bcf428e984b9c78d218 demandimport: explicitly declare `_session` at the module level The `_session` module level variable is set within a function using the `global` keyword. This confuses my `test-check-pyflakes.t`. Explicitly declaring the variable at the top level solves the issue (and seems absolutely reasonable). diff --git a/hgdemandimport/tracing.py b/hgdemandimport/tracing.py --- a/hgdemandimport/tracing.py +++ b/hgdemandimport/tracing.py @@ -12,6 +12,7 @@ import os _pipe = None _checked = False +_session = 'none' def _isactive(): global _pipe, _session, _checked