Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b72a50 commit d6d72dcCopy full SHA for d6d72dc
1 file changed
python/ql/src/semmle/python/Module.qll
@@ -202,11 +202,15 @@ private predicate legalShortName(string name) {
202
}
203
204
/** Holds if `f` is potentially a source package.
205
- * 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?
206
*/
207
private predicate isPotentialSourcePackage(Folder f) {
208
f.getRelativePath() != "" and
209
- exists(f.getFile("__init__.py"))
+ (
210
+ exists(f.getFile("__init__.py"))
211
+ or
212
+ py_flags_versioned("options.respect_init", "False", _) and major_version() = 2
213
+ )
214
215
216
private string moduleNameFromBase(Container file) {
0 commit comments