Skip to content

Commit e53b86f

Browse files
tausbnRasmusWL
andauthored
Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent c378981 commit e53b86f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

python/ql/src/semmle/python/ApiGraphs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ module API {
449449
name = n.getId() and
450450
// Not already defined in an enclosing scope.
451451
not exists(LocalVariable v |
452-
v.getId() = name and v.getScope().getEnclosingScope*() = n.getScope()
452+
v.getId() = name and v.getScope() = n.getScope().getEnclosingScope*()
453453
) and
454454
not name = getBuiltInName() and
455455
s = n.getScope().getEnclosingScope*() and

python/ql/test/experimental/dataflow/ApiGraphs/test_import_star.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# going into it from its corresponding `GlobalSsaVariable`.
77
hello() #$ MISSING: use=moduleImport("unknown").getMember("hello").getReturn()
88

9+
# We don't want our analysis to think that either `non_module_member` or `outer_bar` can
10+
# come from `from unknown import *`
911
non_module_member
1012

1113
outer_bar = 5

0 commit comments

Comments
 (0)