mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Account for --respect-init when determining module name.
This commit is contained in:
@@ -202,11 +202,15 @@ private predicate legalShortName(string name) {
|
||||
}
|
||||
|
||||
/** Holds if `f` is potentially a source package.
|
||||
* Does it have an __init__.py file and is it within the source archive?
|
||||
* Does it have an __init__.py file (or --respect-init=False for Python 2) and is it within the source archive?
|
||||
*/
|
||||
private predicate isPotentialSourcePackage(Folder f) {
|
||||
f.getRelativePath() != "" and
|
||||
exists(f.getFile("__init__.py"))
|
||||
(
|
||||
exists(f.getFile("__init__.py"))
|
||||
or
|
||||
py_flags_versioned("options.respect_init", "False", _) and major_version() = 2
|
||||
)
|
||||
}
|
||||
|
||||
private string moduleNameFromBase(Container file) {
|
||||
|
||||
Reference in New Issue
Block a user