summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Johnson <atagar@torproject.org>2016-03-28 14:38:14 -0700
committerDamian Johnson <atagar@torproject.org>2016-03-28 14:38:14 -0700
commit0fc6178bf07f058bd788ffdacabe1c7897e1b01f (patch)
tree4b75717c6b84aea055562027aabbb58a269fa029
parent7bfc752b69972f7043b260651602b8cb7bc270c4 (diff)
Ignore empty strings in exit policy constructor
Making the constructor behave a bit more intuitively to avoid the confusion in... https://trac.torproject.org/projects/tor/ticket/18666
-rw-r--r--stem/exit_policy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/stem/exit_policy.py b/stem/exit_policy.py
index 003107e5..3d4e66a0 100644
--- a/stem/exit_policy.py
+++ b/stem/exit_policy.py
@@ -449,6 +449,9 @@ class ExitPolicy(object):
decompressed_rules = self._input_rules
for rule in decompressed_rules:
+ if not rule.strip():
+ continue
+
if isinstance(rule, bytes):
rule = stem.util.str_tools._to_unicode(rule)