Remove initialized but thereafter unused variables.
authorSteven Black <redacted>
Mon, 8 Feb 2016 01:25:33 +0000 (20:25 -0500)
committerSteven Black <redacted>
Mon, 8 Feb 2016 01:25:33 +0000 (20:25 -0500)
updateHostsFile.py

index 1bc90a3bb5625191280f72d24d1be1d87b43e49d..4c1ee84ae4a52313f4dc5a019fb889257371f1b2 100644 (file)
@@ -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
git clone https://git.99rst.org/PROJECT