diff --git a/src/dokos/__main__.py b/src/dokos/__main__.py index 920551cc2bbf9f45b56c49216b14ac91b653c67e..36845d0a39efd57077926cc6625918e41e358b00 100644 --- a/src/dokos/__main__.py +++ b/src/dokos/__main__.py @@ -29,9 +29,9 @@ FOUND = [] def print_safe(string) : with LOCK: - print(string) + print(string) -def show_version() : +def show_version() : # where is this file located dirname = os.path.dirname(__file__) with open(os.path.join(dirname, './VERSION')) as version_file: @@ -69,23 +69,21 @@ def try_password(password) : request = urllib.request.Request(ARGS.url, encoded_data) try: - response = urllib.request.urlopen(request) page = response.read().decode() if not ARGS.failed in page : FOUND.append(password) - if ARGS.stop_on_first : + if ARGS.stop_on_first : # ask threads to stop global RUN RUN = False - except urllib.error.HTTPError as e: print_safe("Error: " + repr(e)) except urllib.error.URLError as e: - print_safe("Error: " + repr(e)) + print_safe("Error: " + repr(e)) def try_passwords(passwords): '''