Browse code

make pylint happier

Hanno Böck authored on13/12/2019 12:50:42
Showing1 changed files
... ...
@@ -109,17 +109,19 @@ 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()
116 116
 
117 117
                         if (('extra_match' in det
118
-                           and det['extra_match'] not in filestr)
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']))):
118
+                             and det['extra_match'] not in filestr)
119
+                                or ('extra_nomatch' in det
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)
141
-                           or ('old_safe' in item
142
-                           and findversion in item['old_safe'].split(','))):
142
+                        if ((not versioncompare(item['safe'], findversion))
143
+                                or ('old_safe' in item
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)