[tor-commits] [chutney/master] Keep static analyzers like pyflakes happy about globals

nickm at torproject.org nickm at torproject.org
Thu Aug 21 15:52:18 UTC 2014


commit 60b2d18d81904e6a71a352dfa8b5cb73f4e04003
Author: Daniel Martí <mvdan at mvdan.cc>
Date:   Thu Aug 21 17:42:26 2014 +0200

    Keep static analyzers like pyflakes happy about globals
    
    _BASE_ENVIRON and _THE_NETWORK are set programmatically in main(), so static
    analyzers think that they may not always be declared. So declare them as
    global variables at the beginning and we're good.
---
 lib/chutney/TorNet.py |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 872ff8d..6a1fc8b 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -24,6 +24,9 @@ import time
 import chutney.Templating
 import chutney.Traffic
 
+_BASE_ENVIRON = None
+_THE_NETWORK = None
+
 
 def mkdir_p(d, mode=0777):
     """Create directory 'd' and all of its parents as needed.  Unlike



More information about the tor-commits mailing list