mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
Python: add comment about namespace packages
This commit is contained in:
@@ -195,6 +195,14 @@ private predicate isPotentialPackage(Folder f) {
|
||||
}
|
||||
|
||||
private string moduleNameFromBase(Container file) {
|
||||
// We used to also require `isPotentialPackage(f)` to hold in this case,
|
||||
// but we saw modules not getting resolved because their folder did not
|
||||
// contain an `__init__.py` file.
|
||||
//
|
||||
// This makes the folder not be a package but a namespace package instead.
|
||||
//
|
||||
// It is possible that we can keep the requirement here, but relax
|
||||
// `isPotentialPackage` itself to allow for namespace packages.
|
||||
result = file.getBaseName()
|
||||
or
|
||||
file instanceof File and result = file.getStem()
|
||||
|
||||
Reference in New Issue
Block a user