[tor-commits] [oonib/master] If p is a dictionary (as I assume) then you don't need the .keys().

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


commit 3af27326a39046ad8397fb92a4b5ee398418096b
Author: Darius Bacon <darius at wry.me>
Date:   Fri Mar 28 11:41:11 2014 -0700

    If p is a dictionary (as I assume) then you don't need the .keys().
---
 oonib/policy/handlers.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/oonib/policy/handlers.py b/oonib/policy/handlers.py
index b0c1aa5..cbf1c08 100644
--- a/oonib/policy/handlers.py
+++ b/oonib/policy/handlers.py
@@ -16,9 +16,9 @@ class Policy(object):
             p = yaml.safe_load(f)
         self.input = []
         self.nettest = []
-        if 'nettest' in p.keys():
+        if 'nettest' in p:
             self.nettest = list(p['nettest'])
-        if 'input' in p.keys():
+        if 'input' in p:
             self.input = list(p['input'])
 
     def validateInputHash(self, input_hash):





More information about the tor-commits mailing list