[tor-commits] [ooni-probe/master] Ensure annotations are always dicts

art at torproject.org art at torproject.org
Fri Oct 14 19:00:56 UTC 2016


commit 528ace6a2eec664d86bca38214462d9874b370e2
Author: Arturo Filastò <arturo at filasto.net>
Date:   Fri Oct 14 12:38:07 2016 +0200

    Ensure annotations are always dicts
---
 ooni/nettest.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index 5d33342..b81678b 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -171,6 +171,9 @@ class NetTestLoader(object):
     def __init__(self, options, test_file=None, test_string=None,
                  annotations={}):
         self.options = options
+        # Ensure annotations are always dicts
+        if not isinstance(annotations, dict):
+            annotations = {}
         self.annotations = annotations
         self.annotations['platform'] = self.annotations.get('platform',
                                                             config.platform)





More information about the tor-commits mailing list