From 5100e40440be38fdf72b2f351c93bbb983d634e5 Mon Sep 17 00:00:00 2001 From: maldevel Date: Thu, 21 Apr 2016 10:22:19 +0300 Subject: [PATCH] minor improvement minor improvement --- core/IpGeoLocationLib.py | 2 +- core/Menu.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/IpGeoLocationLib.py b/core/IpGeoLocationLib.py index 22a141e..413861f 100644 --- a/core/IpGeoLocationLib.py +++ b/core/IpGeoLocationLib.py @@ -138,7 +138,7 @@ def GetInfo(self, userAgent, targetsFile=None, def __checkProxyUrl(self, url): """Check if proxy url is valid""" url_checked = urlparse(url) - if ((url_checked.scheme != 'http') & (url_checked.scheme != 'https')) | (url_checked.netloc == ''): + if (url_checked.scheme not in ('http', 'https')) | (url_checked.netloc == ''): return False return url_checked diff --git a/core/Menu.py b/core/Menu.py index 5ab5a34..1e7c04f 100644 --- a/core/Menu.py +++ b/core/Menu.py @@ -70,7 +70,7 @@ def checkFileWrite(filename): def checkProxyUrl(url): """Check if proxy url is valid""" url_checked = urlparse(url) - if ((url_checked.scheme != 'http') & (url_checked.scheme != 'https')) | (url_checked.netloc == ''): + if (url_checked.scheme not in ('http', 'https')) | (url_checked.netloc == ''): raise argparse.ArgumentTypeError('Invalid {} Proxy URL (example: http://127.0.0.1:8080).'.format(url)) return url_checked