]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/tidyup.py
Continued:
[fba.git] / fba / helpers / tidyup.py
index 580cb225dcc0fbd307ca30c430a926afd4d69154..acd8bc655475bfc6cd4b472a0b0b1f53cd6edd54 100644 (file)
@@ -36,9 +36,11 @@ def domain(string: str) -> str:
 
     if not isinstance(string, str):
         raise ValueError(f"Parameter string[]='{type(string)}' is not of type 'str'")
+    elif string == "":
+        raise ValueError("Parameter string is empty")
 
     # All lower-case and strip spaces out + last dot
-    string = string.lower().strip().rstrip(".")
+    string = string.lower().strip().rstrip(".").replace("..", ".")
     logger.debug("string='%s' - #1", string)
 
     # No port number