From: Steven Black Date: Mon, 8 Feb 2016 01:25:33 +0000 (-0500) Subject: Remove initialized but thereafter unused variables. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=ea43296b84fa06b1e3430101d00ad83c69a77434;p=stevenblack-hosts.git Remove initialized but thereafter unused variables. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 1bc90a3bb..4c1ee84ae 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -109,7 +109,7 @@ def promptForUpdate(): # Create hosts file if it doesn't exists if not os.path.isfile(os.path.join(BASEDIR_PATH, 'hosts')): try: - file = open(os.path.join(BASEDIR_PATH, 'hosts'), 'w+').close() + open(os.path.join(BASEDIR_PATH, 'hosts'), 'w+').close() except: printFailure("ERROR: No 'hosts' file in the folder, try creating one manually") @@ -266,7 +266,7 @@ def removeDupsAndExcl(mergeFile): def normalizeRule(rule): result = re.search(r'^[ \t]*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)', rule) if result: - target, hostname, suffix = result.groups() + hostname, suffix = result.group(2,3) hostname = hostname.lower() # explicitly lowercase hostname if suffix is not '': # add suffix as comment only, not as a separate host