[tor-commits] [onionperf/master] Fixes return type for IP address function
irl at torproject.org
irl at torproject.org
Thu Apr 25 10:44:44 UTC 2019
commit 7e59d26d268c2f98f5ea59cb194fc35c775ac623
Author: Ana C. Custura <ana at netstat.org.uk>
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:
More information about the tor-commits
mailing list