[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[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.)



commit 67788384562254bbf8a8b6f1edaf7812cf2d83fa
Author: Darius Bacon <darius@xxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits