commit 1b0eb6916fd457a5021cbb36003fe99291420bdb Author: David Fifield david@bamsoftware.com Date: Fri Sep 20 22:24:09 2013 -0700
Use setdefault. --- facilitator/facilitator | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/facilitator/facilitator b/facilitator/facilitator index abc0815..d131b1f 100755 --- a/facilitator/facilitator +++ b/facilitator/facilitator @@ -57,9 +57,7 @@ class options(object): @staticmethod def add_relay(transport, spec): spec = fac.parse_addr_spec(spec, defport = DEFAULT_RELAY_PORT, resolve = True) - if transport not in options.relays: - options.relays[transport] = [] - + options.relays.setdefault(transport, []) options.relays[transport].append(fac.format_addr(spec))
def usage(f = sys.stdout):
tor-commits@lists.torproject.org