Commit 220f227
committed
Python: Add wrapper for
We talked about how it's annoying that we in 4 places have the same fix
`isPreferredModuleForName(<module>.getFile(), <name> + ["", ".__init__"])`
, and that it would be nice to have a simple wrapper predicate that
ensures we never forget to do the `+ ["", ".__init__"]` dance...
I had trouble coming up with a name for this (ironically), but
I think `getModuleFromName` is good enough.isPreferredModuleForName
1 parent 66c3529 commit 220f227
File tree
1 file changed
+17
-5
lines changed- python/ql/lib/semmle/python/dataflow/new/internal
1 file changed
+17
-5
lines changedLines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | | - | |
| 185 | + | |
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
| |||
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
227 | | - | |
| 240 | + | |
228 | 241 | | |
229 | 242 | | |
230 | 243 | | |
| |||
235 | 248 | | |
236 | 249 | | |
237 | 250 | | |
238 | | - | |
| 251 | + | |
239 | 252 | | |
240 | 253 | | |
241 | 254 | | |
| |||
249 | 262 | | |
250 | 263 | | |
251 | 264 | | |
252 | | - | |
253 | | - | |
| 265 | + | |
254 | 266 | | |
255 | 267 | | |
256 | 268 | | |
| |||
0 commit comments