From cdfb97f6e674a5e619371bbddd1dbfdbb66a0346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=83=81=EB=8F=99=ED=98=81?= Date: Sun, 24 May 2020 12:35:04 +0900 Subject: [PATCH] Use `is` operator when comparing singletons. --- sherlock/notify.py | 2 +- sherlock/sherlock.py | 8 ++++---- sherlock/sites.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sherlock/notify.py b/sherlock/notify.py index 0e2b160..51e974c 100644 --- a/sherlock/notify.py +++ b/sherlock/notify.py @@ -218,7 +218,7 @@ class QueryNotifyPrint(QueryNotify): else: print(f"[-] {self.result.site_name}: {self.result.context} ") elif result.status == QueryStatus.ILLEGAL: - if self.print_found_only == False: + if not self.print_found_only: msg = "Illegal Username Format For This Site!" if self.color: print((Style.BRIGHT + Fore.WHITE + "[" + diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index da0fcc0..90f6dac 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -255,7 +255,7 @@ def sherlock(username, site_data, query_notify, allow_redirects = True # This future starts running the request in a new thread, doesn't block the main thread - if proxy != None: + if proxy is not None: proxies = {"http": proxy, "https": proxy} future = request_method(url=url_probe, headers=headers, proxies=proxies, @@ -499,11 +499,11 @@ def main(): # Argument check # TODO regex check on args.proxy - if args.tor and (args.proxy != None): + if args.tor and (args.proxy is not None): raise Exception("Tor and Proxy cannot be set at the same time.") # Make prompts - if args.proxy != None: + if args.proxy is not None: print("Using the proxy: " + args.proxy) if args.tor or args.unique_tor: @@ -603,7 +603,7 @@ def main(): file.write(dictionary["url_user"] + "\n") file.write(f"Total Websites Username Detected On : {exists_counter}") - if args.csv == True: + if args.csv: with open(username + ".csv", "w", newline='', encoding="utf-8") as csv_report: writer = csv.writer(csv_report) writer.writerow(['username', diff --git a/sherlock/sites.py b/sherlock/sites.py index 3850c15..25ea009 100644 --- a/sherlock/sites.py +++ b/sherlock/sites.py @@ -208,7 +208,7 @@ class SitesInformation(): List of strings containing names of sites. """ - if popularity_rank == True: + if popularity_rank: #Sort in ascending popularity rank order. site_rank_name = \ sorted([(site.popularity_rank,site.name) for site in self],