File tree Expand file tree Collapse file tree
python/ql/src/semmle/python/types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ private import semmle.python.types.ModuleKind
66abstract class ModuleObject extends Object {
77
88 ModuleValue theModule ( ) {
9- result .getSource ( ) = this
9+ result .( PythonModuleObjectInternal ) .getSourceModule ( ) = this .getModule ( )
10+ or
11+ result .( PackageObjectInternal ) .getFolder ( ) = this .( PackageObject ) .getPath ( )
12+ or
13+ result .( BuiltinModuleObjectInternal ) .getBuiltin ( ) = this
1014 }
1115
1216 /** Gets the scope corresponding to this module, if this is a Python module */
@@ -223,7 +227,7 @@ class PackageObject extends ModuleObject {
223227
224228 override Object getAttribute ( string name ) {
225229 exists ( Value val |
226- theModule ( ) .( PackageObjectInternal ) .attribute ( name , _ , _) and
230+ theModule ( ) .( PackageObjectInternal ) .attribute ( name , val , _) and
227231 result = val .getSource ( )
228232 )
229233 }
You can’t perform that action at this time.
0 commit comments