commit f955d14f25041846cdc82a8e59fe704378a6f6ac Author: Ravi Chandra Padmala neenaoffline@gmail.com Date: Tue Aug 7 12:02:03 2012 +0530
Fix version parsing in NetworkStatusDocument --- stem/descriptor/networkstatus_descriptor.py | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/stem/descriptor/networkstatus_descriptor.py b/stem/descriptor/networkstatus_descriptor.py index 5c7d58e..c568d76 100644 --- a/stem/descriptor/networkstatus_descriptor.py +++ b/stem/descriptor/networkstatus_descriptor.py @@ -172,10 +172,12 @@ class NetworkStatusDocument(stem.descriptor.Descriptor): voting_delay = doc_parser.read_keyword_line("voting-delay") self.vote_delay, self.dist_delay = [int(delay) for delay in voting_delay.split(" ")]
- read_keyword_line("client-versions", True) - self.client_versions = [stem.version.Version(version_string) for version_string in self.client_versions.split(",")] - read_keyword_line("server-versions", True) - self.server_versions = [stem.version.Version(version_string) for version_string in self.server_versions.split(",")] + client_versions = doc_parser.read_keyword_line("client-versions", True) + if client_versions: + self.client_versions = [stem.version.Version(version_string) for version_string in client_versions.split(",")] + server_versions = doc_parser.read_keyword_line("server-versions", True) + if server_versions: + self.server_versions = [stem.version.Version(version_string) for version_string in server_versions.split(",")] self.known_flags = doc_parser.read_keyword_line("known-flags").split(" ") read_keyword_line("params", True) if self.params: