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 307f443 commit 8f70c9fCopy full SHA for 8f70c9f
python/ql/lib/semmle/python/Module.qll
@@ -195,6 +195,14 @@ private predicate isPotentialPackage(Folder f) {
195
}
196
197
private string moduleNameFromBase(Container file) {
198
+ // We used to also require `isPotentialPackage(f)` to hold in this case,
199
+ // but we saw modules not getting resolved because their folder did not
200
+ // contain an `__init__.py` file.
201
+ //
202
+ // This makes the folder not be a package but a namespace package instead.
203
204
+ // It is possible that we can keep the requirement here, but relax
205
+ // `isPotentialPackage` itself to allow for namespace packages.
206
result = file.getBaseName()
207
or
208
file instanceof File and result = file.getStem()
0 commit comments