[asterisk-commits] pabelanger: branch pabelanger/sipp r1126 - /asterisk/team/pabelanger/sipp/lib...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 9 16:56:42 CST 2010


Author: pabelanger
Date: Thu Dec  9 16:56:38 2010
New Revision: 1126

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1126
Log:
More logic fixes

Modified:
    asterisk/team/pabelanger/sipp/lib/python/sipp/version.py

Modified: asterisk/team/pabelanger/sipp/lib/python/sipp/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/sipp/lib/python/sipp/version.py?view=diff&rev=1126&r1=1125&r2=1126
==============================================================================
--- asterisk/team/pabelanger/sipp/lib/python/sipp/version.py (original)
+++ asterisk/team/pabelanger/sipp/lib/python/sipp/version.py Thu Dec  9 16:56:38 2010
@@ -27,9 +27,7 @@
         version -- The SIPp version string to parse.
         """
         self.version_str = ""
-        if version is not None:
-            self.version_str = version
-        else:
+        if version is None:
             sipp = utils.which("sipp")
             if sipp:
                 cmd = [
@@ -45,6 +43,8 @@
                         ver = line.strip().lstrip('SIPp ')
                         ver = ver.split(',', 1)
                         self.version_str = ver[0]
+        else:
+            self.version_str = version
 
         if not self.version_str:
             return
@@ -71,7 +71,7 @@
 
     def __ne__(self, other):
         res = self.__cmp__(other)
-        if res == 0 and (self.tls or self.pcap or other.tls or other.pcap):
+        if ((res == 0) and (self.tls or self.pcap or other.tls or other.pcap)):
             if (self.tls == other.pcap) or (self.pcap == other.tls):
                 return True
             return False
@@ -79,8 +79,7 @@
 
     def __eq__(self, other):
         res = self.__cmp__(other)
-        if res == 0:
-            if self.tls == other.tls and self.pcap == other.pcap:
+        if ((res == 0) and (self.tls == other.tls and self.pcap == other.pcap)):
                 return True
         return False
 




More information about the asterisk-commits mailing list