[tor-commits] [metrics-tasks/master] Accept upper-case country codes, too (#6329).

karsten at torproject.org karsten at torproject.org
Fri Jul 20 14:00:01 UTC 2012


commit 5ca7405e9f423fcb85a21557ae9ee82ef78bb028
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Jul 20 15:35:53 2012 +0200

    Accept upper-case country codes, too (#6329).
---
 task-6329/tor-relays-stats.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/task-6329/tor-relays-stats.py b/task-6329/tor-relays-stats.py
index e62782a..a2086f4 100755
--- a/task-6329/tor-relays-stats.py
+++ b/task-6329/tor-relays-stats.py
@@ -24,6 +24,8 @@ class RelayStats(object):
 
     def get_relays(self, countries=[], as_sets=[], exits_only=False, guards_only=False):
         relays = []
+        if countries:
+            countries = [x.lower() for x in countries]
         for relay in self.data['relays']:
             if not relay['running']:
                 continue





More information about the tor-commits mailing list