]> granicus.if.org Git - zfs/commitdiff
Correct flake8 errors after STYLE builder update
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Mon, 23 Oct 2017 21:01:43 +0000 (14:01 -0700)
committerTony Hutter <hutter2@llnl.gov>
Mon, 20 Nov 2017 22:19:23 +0000 (16:19 -0600)
Fix new flake8 errors related to bare excepts and ambiguous
variable names due to a STYLE builder update.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #6776

cmd/arcstat/arcstat.py
tests/test-runner/cmd/test-runner.py

index b743fd8bc4268eef8960de20770a225bfe966b82..d969da8d4e48bb87fe5d654654f341228b5e1625 100755 (executable)
@@ -238,7 +238,7 @@ def get_terminal_lines():
         data = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, '1234')
         sz = struct.unpack('hh', data)
         return sz[0]
-    except:
+    except Exception:
         pass
 
 
index 4c53257dfb630a50068a9bd0474fa4d9e06b895f..8ad903c24f740715ca7a8c22e2f866c67ec3d79e 100755 (executable)
@@ -150,7 +150,7 @@ class Cmd(object):
         try:
             kp = Popen(cmd)
             kp.wait()
-        except:
+        except Exception:
             pass
 
     def update_cmd_privs(self, cmd, user):
@@ -629,16 +629,16 @@ class TestRun(object):
         base = self.outputdir
 
         while not done:
-            l = []
+            paths = []
             components -= 1
             for testfile in tmp_dict.keys():
                 uniq = '/'.join(testfile.split('/')[components:]).lstrip('/')
-                if uniq not in l:
-                    l.append(uniq)
+                if uniq not in paths:
+                    paths.append(uniq)
                     tmp_dict[testfile].outputdir = os.path.join(base, uniq)
                 else:
                     break
-            done = total == len(l)
+            done = total == len(paths)
 
     def setup_logging(self, options):
         """