make pylint happier
Hanno Böck

Hanno Böck commited on 2019-12-13 12:50:42
Zeige 1 geänderte Dateien mit 9 Einfügungen und 6 Löschungen.

... ...
@@ -109,7 +109,7 @@ for fdir in opts.dirs:
109 109
                         mfile = os.path.join(root, filename)
110 110
                         try:
111 111
                             file = open(mfile, errors='replace')
112
-                        except Exception:
112
+                        except IOError:
113 113
                             continue
114 114
                         filestr = file.read()
115 115
                         file.close()
... ...
@@ -117,9 +117,11 @@ for fdir in opts.dirs:
117 117
                         if (('extra_match' in det
118 118
                              and det['extra_match'] not in filestr)
119 119
                                 or ('extra_nomatch' in det
120
-                           and det['extra_nomatch'] in filestr)
121
-                           or ('path_match' in det
122
-                           and not root.endswith(det['path_match']))):
120
+                                    and det['extra_nomatch'] in filestr)):
121
+                            continue
122
+
123
+                        if ('path_match' in det
124
+                                and (not root.endswith(det['path_match']))):
123 125
                             continue
124 126
 
125 127
                         findversion = re.search(re.escape(det['variable'])
... ...
@@ -137,9 +139,10 @@ for fdir in opts.dirs:
137 139
                                                   + int(det['add_minor']))
138 140
                             findversion = '.'.join(findversion)
139 141
 
140
-                        if (not versioncompare(item['safe'], findversion)
142
+                        if ((not versioncompare(item['safe'], findversion))
141 143
                                 or ('old_safe' in item
142
-                           and findversion in item['old_safe'].split(','))):
144
+                                    and findversion in
145
+                                    item['old_safe'].split(','))):
143 146
                             if opts.all:
144 147
                                 vulnprint(item['name'], findversion, "ok", "",
145 148
                                           mfile, det['subdir'], opts.xml)
146 149