demandimport: explicitly declare `_session` at the module level stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 08 Aug 2019 11:06:13 +0200
branchstable
changeset 42709 978c9a0c5974
parent 42708 bac24a8a095a
child 42713 2c1a484ce4d4
child 42716 50c2c3eae64e
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).
hgdemandimport/tracing.py
--- a/hgdemandimport/tracing.py	Thu Aug 08 10:55:06 2019 +0200
+++ b/hgdemandimport/tracing.py	Thu Aug 08 11:06:13 2019 +0200
@@ -12,6 +12,7 @@
 
 _pipe = None
 _checked = False
+_session = 'none'
 
 def _isactive():
     global _pipe, _session, _checked