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

[tor-commits] [onionperf/master] Fixes return type for IP address function



commit 7e59d26d268c2f98f5ea59cb194fc35c775ac623
Author: Ana C. Custura <ana@xxxxxxxxxxxxxx>
Date:   Mon Apr 22 16:25:06 2019 +0100

    Fixes return type for IP address function
---
 onionperf/util.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/onionperf/util.py b/onionperf/util.py
index 2448600..b8a736a 100644
--- a/onionperf/util.py
+++ b/onionperf/util.py
@@ -117,13 +117,13 @@ def find_ip_address_url(data):
     """
     Parses a string using a regular expression for identifying IPv4 addressses.
     If more than one IP address is found, only the first one is returned.
-    If no IP address is found, the function returns an empty string.
+    If no IP address is found, the function returns None .
 
     :param data: string
     :returns: string
     """
 
-    ip_address = ""
+    ip_address = None
     if data is not None and len(data) > 0:
         ip_list = re.findall(r'[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}', data)
         if ip_list is not None and len(ip_list) > 0:

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