[tor-commits] [oonib/master] Most of the body of this doesn't need to be in the scope of the 'with'. (This comes up in lots of the other 'with's in this codebase.)

art at torproject.org art at torproject.org
Wed Apr 23 14:31:51 UTC 2014


commit 8ade100d5df1730c6d953c5f1916cb79234d8fd4
Author: Darius Bacon <darius at wry.me>
Date:   Fri Mar 28 11:37:31 2014 -0700

    Most of the body of this doesn't need to be in the scope of the 'with'. (This comes up in lots of the other 'with's in this codebase.)
---
 oonib/policy/handlers.py |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/oonib/policy/handlers.py b/oonib/policy/handlers.py
index ac12c00..7f753b0 100644
--- a/oonib/policy/handlers.py
+++ b/oonib/policy/handlers.py
@@ -14,11 +14,11 @@ class Policy(object):
     def __init__(self):
         with open(config.main.policy_file) as f:
             p = yaml.safe_load(f)
-            self.input = self.nettest = []
-            if 'nettest' in p.keys():
-                self.nettest = list(p['nettest'])
-            if 'input' in p.keys():
-                self.input = list(p['input'])
+        self.input = self.nettest = []
+        if 'nettest' in p.keys():
+            self.nettest = list(p['nettest'])
+        if 'input' in p.keys():
+            self.input = list(p['input'])
 
     def validateInputHash(self, input_hash):
         valid = False





More information about the tor-commits mailing list