We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9854eb commit 4f35a62Copy full SHA for 4f35a62
python/ql/lib/semmle/python/Module.qll
@@ -254,9 +254,10 @@ private predicate isNameSpacePackage(Folder f, string name) {
254
legalShortName(name) and
255
name = f.getStem() and
256
not isRegularPackage(f, name) and
257
- // it has to be imported in this folder
+ // it has to be imported in a file
258
+ // either in this folder or next to this folder
259
name =
- any(ImportExpr i | i.getLocation().getFile().getParent() = f)
260
+ any(ImportExpr i | i.getLocation().getFile().getParent() in [f, f.getParent()])
261
.getName()
262
.regexpReplaceAll("\\..*", "") and
263
name != "" and
0 commit comments