[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Neater string finding code



commit d2f7e1925e61bf73c8d7a78ed48a01badb5399a0
Author: Ravi Chandra Padmala <neenaoffline@xxxxxxxxx>
Date:   Sun Mar 25 20:58:54 2012 +0530

    Neater string finding code
---
 stem/version.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stem/version.py b/stem/version.py
index 350eceb..8afd52b 100644
--- a/stem/version.py
+++ b/stem/version.py
@@ -57,7 +57,7 @@ def get_system_tor_version(tor_cmd = "tor"):
       
       if last_line.startswith("Tor version ") and last_line.endswith("."):
         try:
-          version_str = last_line[12:12 + last_line[12:].find(' ')]
+          version_str = last_line[12:last_line.find(' ', 12)]
           VERSION_CACHE[tor_cmd] = Version(version_str)
         except ValueError, exc:
           raise IOError(exc)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits