From 542952cd75f0f76f40f04c7be50253e916cae43a Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 27 Apr 2019 09:31:17 +0530 Subject: [PATCH] Handle LocationParseError from parse_url() --- buku | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/buku b/buku index 3c12bfa..87cc884 100755 --- a/buku +++ b/buku @@ -3139,14 +3139,14 @@ def is_bad_url(url): # Get the netloc token try: netloc = parse_url(url).netloc + if not netloc: + # Try of prepend '//' and get netloc + netloc = parse_url('//' + url).netloc + if not netloc: + return True except LocationParseError as e: LOGERR('%s, URL: %s', e, url) return True - if not netloc: - # Try of prepend '//' and get netloc - netloc = parse_url('//' + url).netloc - if not netloc: - return True LOGDBG('netloc: %s', netloc)