[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [weather/master] Fix get_highest_version(), so it really returns the highest version. Thanks, rransom.
commit 1cfd17ad5e86355162ae052dc73774b617efed32
Author: Christian Fromme <kaner@xxxxxxxxxx>
Date: Sun Feb 27 11:42:51 2011 +0100
Fix get_highest_version(), so it really returns the highest version. Thanks, rransom.
---
weather/weatherapp/ctlutil.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/weather/weatherapp/ctlutil.py b/weather/weatherapp/ctlutil.py
index 88a098f..93c6318 100644
--- a/weather/weatherapp/ctlutil.py
+++ b/weather/weatherapp/ctlutil.py
@@ -238,8 +238,14 @@ class CtlUtil:
"""
if len(versionlist) is 0:
return ""
- versionlist.sort()
- return versionlist[-1]
+
+ highest = TorCtl.RouterVersion("0.0.0.0")
+ for v in versionlist:
+ cur = TorCtl.RouterVersion(v)
+ if cur > highest:
+ highest = cur
+
+ return str(highest)
def get_version_type(self, fingerprint):
"""Get the type of version the relay with fingerprint C{fingerprint}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits