Skip to content

Commit

Permalink
Check on url validity
Browse files Browse the repository at this point in the history
  • Loading branch information
margalva committed Sep 26, 2023
1 parent a0b612c commit 70905f1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def __init__(self, url=None, username=None, password=None):
# Check on the validity of url formatting
if url is not None:
o = urlparse(url)
if o is False:
is_valid = True if o.scheme and o.netloc else False
if is_valid is False:
if print_allowed():
print("Error: invalid URL. Setting it to None")
url = None
Expand Down

0 comments on commit 70905f1

Please sign in to comment.