Python: Take __all__ into consideration for re-export of from <pkg> import *

However, we can see that `from <pkg> import *` and `import pkg` are
handled differently. Would have liked `has_defined_all_indirection` to
behave in the same way no matter how the import was made.
This commit is contained in:
Rasmus Wriedt Larsen
2023-02-22 15:33:02 +01:00
parent be5812cf91
commit c8a76246d8
3 changed files with 6 additions and 135 deletions

View File

@@ -95,7 +95,11 @@ module ImportResolution {
)
or
// `from <pkg> import *`
module_export(ImportStar::getStarImported+(m), name, defn)
exists(Module importedFrom |
importedFrom = ImportStar::getStarImported(m) and
module_export(importedFrom, name, defn) and
potential_module_export(importedFrom, name)
)
or
// `import <pkg>` or `from <pkg> import <stuff>`
exists(Alias a |

View File

@@ -1,180 +1,93 @@
| attr_clash.__init__ | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| attr_clash.__init__ | __file__ | attr_clash/__init__.py:2:7:2:14 | ControlFlowNode for __file__ |
| attr_clash.__init__ | __file__ | attr_clash/__init__.py:6:6:6:13 | ControlFlowNode for __file__ |
| attr_clash.__init__ | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| attr_clash.__init__ | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| attr_clash.__init__ | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| attr_clash.__init__ | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| attr_clash.__init__ | clashing_attr | attr_clash/__init__.py:4:17:4:31 | ControlFlowNode for Str |
| attr_clash.__init__ | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| attr_clash.__init__ | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| attr_clash.__init__ | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| attr_clash.__init__ | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| attr_clash.__init__ | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| attr_clash.clashing_attr | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| attr_clash.clashing_attr | __file__ | attr_clash/clashing_attr.py:2:7:2:14 | ControlFlowNode for __file__ |
| attr_clash.clashing_attr | __file__ | attr_clash/clashing_attr.py:4:6:4:13 | ControlFlowNode for __file__ |
| attr_clash.clashing_attr | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| attr_clash.clashing_attr | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| attr_clash.clashing_attr | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| attr_clash.clashing_attr | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| attr_clash.clashing_attr | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| attr_clash.clashing_attr | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| attr_clash.clashing_attr | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| attr_clash.clashing_attr | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| attr_clash.clashing_attr | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| attr_clash.non_clashing_submodule | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| attr_clash.non_clashing_submodule | __file__ | attr_clash/non_clashing_submodule.py:2:7:2:14 | ControlFlowNode for __file__ |
| attr_clash.non_clashing_submodule | __file__ | attr_clash/non_clashing_submodule.py:4:6:4:13 | ControlFlowNode for __file__ |
| attr_clash.non_clashing_submodule | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| attr_clash.non_clashing_submodule | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| attr_clash.non_clashing_submodule | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| attr_clash.non_clashing_submodule | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| attr_clash.non_clashing_submodule | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| attr_clash.non_clashing_submodule | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| attr_clash.non_clashing_submodule | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| attr_clash.non_clashing_submodule | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| attr_clash.non_clashing_submodule | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| bar | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| bar | __file__ | bar.py:2:7:2:14 | ControlFlowNode for __file__ |
| bar | __file__ | bar.py:6:6:6:13 | ControlFlowNode for __file__ |
| bar | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| bar | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| bar | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| bar | bar_attr | bar.py:4:12:4:21 | ControlFlowNode for Str |
| bar | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| bar | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| bar | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| bar | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| bar | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| bar | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| baz | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| baz | __file__ | baz.py:2:7:2:14 | ControlFlowNode for __file__ |
| baz | __file__ | baz.py:6:6:6:13 | ControlFlowNode for __file__ |
| baz | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| baz | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| baz | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| baz | baz_attr | baz.py:4:12:4:21 | ControlFlowNode for Str |
| baz | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| baz | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| baz | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| baz | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| baz | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| baz | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| foo | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| foo | __file__ | foo.py:2:7:2:14 | ControlFlowNode for __file__ |
| foo | __file__ | foo.py:14:6:14:13 | ControlFlowNode for __file__ |
| foo | __private_foo_attr | foo.py:8:22:8:41 | ControlFlowNode for Str |
| foo | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| foo | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| foo | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| foo | bar_reexported | foo.py:11:8:11:10 | ControlFlowNode for ImportExpr |
| foo | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| foo | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| foo | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| foo | foo_attr | foo.py:5:12:5:21 | ControlFlowNode for Str |
| foo | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| foo | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| foo | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| has_defined_all | __all__ | has_defined_all.py:7:11:7:29 | ControlFlowNode for List |
| has_defined_all | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| has_defined_all | __file__ | has_defined_all.py:2:7:2:14 | ControlFlowNode for __file__ |
| has_defined_all | __file__ | has_defined_all.py:9:6:9:13 | ControlFlowNode for __file__ |
| has_defined_all | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| has_defined_all | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| has_defined_all | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| has_defined_all | all_defined_bar | has_defined_all.py:5:19:5:35 | ControlFlowNode for Str |
| has_defined_all | all_defined_foo | has_defined_all.py:4:19:4:35 | ControlFlowNode for Str |
| has_defined_all | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| has_defined_all | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| has_defined_all | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| has_defined_all | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| has_defined_all | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| has_defined_all | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| has_defined_all_copy | __all__ | has_defined_all_copy.py:9:11:9:34 | ControlFlowNode for List |
| has_defined_all_copy | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| has_defined_all_copy | __file__ | has_defined_all_copy.py:4:7:4:14 | ControlFlowNode for __file__ |
| has_defined_all_copy | __file__ | has_defined_all_copy.py:11:6:11:13 | ControlFlowNode for __file__ |
| has_defined_all_copy | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| has_defined_all_copy | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| has_defined_all_copy | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| has_defined_all_copy | all_defined_bar_copy | has_defined_all_copy.py:7:24:7:45 | ControlFlowNode for Str |
| has_defined_all_copy | all_defined_foo_copy | has_defined_all_copy.py:6:24:6:45 | ControlFlowNode for Str |
| has_defined_all_copy | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| has_defined_all_copy | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| has_defined_all_copy | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| has_defined_all_copy | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| has_defined_all_copy | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| has_defined_all_copy | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| has_defined_all_indirection | __all__ | has_defined_all_copy.py:9:11:9:34 | ControlFlowNode for List |
| has_defined_all_indirection | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| has_defined_all_indirection | __file__ | has_defined_all_copy.py:4:7:4:14 | ControlFlowNode for __file__ |
| has_defined_all_indirection | __file__ | has_defined_all_copy.py:11:6:11:13 | ControlFlowNode for __file__ |
| has_defined_all_indirection | __file__ | has_defined_all_indirection.py:2:7:2:14 | ControlFlowNode for __file__ |
| has_defined_all_indirection | __file__ | has_defined_all_indirection.py:6:6:6:13 | ControlFlowNode for __file__ |
| has_defined_all_indirection | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| has_defined_all_indirection | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| has_defined_all_indirection | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| has_defined_all_indirection | all_defined_bar_copy | has_defined_all_copy.py:7:24:7:45 | ControlFlowNode for Str |
| has_defined_all_indirection | all_defined_foo_copy | has_defined_all_copy.py:6:24:6:45 | ControlFlowNode for Str |
| has_defined_all_indirection | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| has_defined_all_indirection | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| has_defined_all_indirection | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| has_defined_all_indirection | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| has_defined_all_indirection | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| has_defined_all_indirection | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| if_then_else | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| if_then_else | __file__ | if_then_else.py:2:7:2:14 | ControlFlowNode for __file__ |
| if_then_else | __file__ | if_then_else.py:16:6:16:13 | ControlFlowNode for __file__ |
| if_then_else | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| if_then_else | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| if_then_else | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| if_then_else | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| if_then_else | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| if_then_else | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| if_then_else | if_then_else_defined | if_then_else.py:7:28:7:39 | ControlFlowNode for Str |
| if_then_else | if_then_else_defined | if_then_else.py:12:32:12:47 | ControlFlowNode for Str |
| if_then_else | if_then_else_defined | if_then_else.py:14:32:14:47 | ControlFlowNode for Str |
| if_then_else | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| if_then_else | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| if_then_else | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| if_then_else_refined | SOURCE | if_then_else_refined.py:6:1:6:15 | ControlFlowNode for ClassExpr |
| if_then_else_refined | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| if_then_else_refined | __file__ | if_then_else_refined.py:4:7:4:14 | ControlFlowNode for __file__ |
| if_then_else_refined | __file__ | if_then_else_refined.py:19:6:19:13 | ControlFlowNode for __file__ |
| if_then_else_refined | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| if_then_else_refined | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| if_then_else_refined | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| if_then_else_refined | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| if_then_else_refined | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| if_then_else_refined | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| if_then_else_refined | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| if_then_else_refined | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| if_then_else_refined | src | if_then_else_refined.py:11:11:11:16 | ControlFlowNode for SOURCE |
| if_then_else_refined | src | if_then_else_refined.py:13:11:13:16 | ControlFlowNode for SOURCE |
| if_then_else_refined | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| main | __all__ | has_defined_all.py:7:11:7:29 | ControlFlowNode for List |
| main | __all__ | has_defined_all_copy.py:9:11:9:34 | ControlFlowNode for List |
| main | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| main | __file__ | has_defined_all.py:2:7:2:14 | ControlFlowNode for __file__ |
| main | __file__ | has_defined_all.py:9:6:9:13 | ControlFlowNode for __file__ |
| main | __file__ | has_defined_all_copy.py:4:7:4:14 | ControlFlowNode for __file__ |
| main | __file__ | has_defined_all_copy.py:11:6:11:13 | ControlFlowNode for __file__ |
| main | __file__ | has_defined_all_indirection.py:2:7:2:14 | ControlFlowNode for __file__ |
| main | __file__ | has_defined_all_indirection.py:6:6:6:13 | ControlFlowNode for __file__ |
| main | __file__ | main.py:24:7:24:14 | ControlFlowNode for __file__ |
| main | __file__ | main.py:149:6:149:13 | ControlFlowNode for __file__ |
| main | __file__ | package/subpackage2/__init__.py:2:7:2:14 | ControlFlowNode for __file__ |
| main | __file__ | package/subpackage2/__init__.py:6:6:6:13 | ControlFlowNode for __file__ |
| main | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| main | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| main | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| main | aliased_subpackage | main.py:54:21:54:52 | ControlFlowNode for ImportMember |
| main | aliased_subpackage | main.py:65:8:65:25 | ControlFlowNode for ImportExpr |
| main | all_defined_bar | has_defined_all.py:5:19:5:35 | ControlFlowNode for Str |
| main | all_defined_bar_copy | has_defined_all_copy.py:7:24:7:45 | ControlFlowNode for Str |
| main | all_defined_foo | has_defined_all.py:4:19:4:35 | ControlFlowNode for Str |
| main | all_defined_foo_copy | has_defined_all_copy.py:6:24:6:45 | ControlFlowNode for Str |
| main | bar_attr | main.py:42:17:42:24 | ControlFlowNode for ImportMember |
| main | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| main | clashing_attr | main.py:83:24:83:36 | ControlFlowNode for ImportMember |
@@ -192,105 +105,61 @@
| main | package | main.py:69:8:69:25 | ControlFlowNode for ImportExpr |
| main | package | main.py:73:8:73:35 | ControlFlowNode for ImportExpr |
| main | package_attr_alias | main.py:50:21:50:54 | ControlFlowNode for ImportMember |
| main | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| main | print_function | main.py:21:24:21:37 | ControlFlowNode for ImportMember |
| main | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| main | refined | main.py:139:8:139:14 | ControlFlowNode for ImportExpr |
| main | simplistic_reexport | main.py:145:8:145:26 | ControlFlowNode for ImportExpr |
| main | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| main | subpackage2_attr | package/subpackage2/__init__.py:4:20:4:37 | ControlFlowNode for Str |
| main | subpackage_attr | main.py:46:32:46:46 | ControlFlowNode for ImportMember |
| main | sys | main.py:22:8:22:10 | ControlFlowNode for ImportExpr |
| namespace_package.namespace_module | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| namespace_package.namespace_module | __file__ | namespace_package/namespace_module.py:2:7:2:14 | ControlFlowNode for __file__ |
| namespace_package.namespace_module | __file__ | namespace_package/namespace_module.py:6:6:6:13 | ControlFlowNode for __file__ |
| namespace_package.namespace_module | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| namespace_package.namespace_module | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| namespace_package.namespace_module | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| namespace_package.namespace_module | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| namespace_package.namespace_module | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| namespace_package.namespace_module | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| namespace_package.namespace_module | namespace_module_attr | namespace_package/namespace_module.py:4:25:4:47 | ControlFlowNode for Str |
| namespace_package.namespace_module | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| namespace_package.namespace_module | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| namespace_package.namespace_module | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| package.__init__ | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| package.__init__ | __file__ | package/__init__.py:2:7:2:14 | ControlFlowNode for __file__ |
| package.__init__ | __file__ | package/__init__.py:7:6:7:13 | ControlFlowNode for __file__ |
| package.__init__ | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| package.__init__ | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| package.__init__ | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| package.__init__ | attr_used_in_subpackage | package/__init__.py:4:27:4:51 | ControlFlowNode for Str |
| package.__init__ | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| package.__init__ | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| package.__init__ | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| package.__init__ | package_attr | package/__init__.py:5:16:5:29 | ControlFlowNode for Str |
| package.__init__ | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| package.__init__ | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| package.__init__ | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| package.subpackage2.__init__ | __file__ | package/subpackage2/__init__.py:2:7:2:14 | ControlFlowNode for __file__ |
| package.subpackage2.__init__ | __file__ | package/subpackage2/__init__.py:6:6:6:13 | ControlFlowNode for __file__ |
| package.subpackage2.__init__ | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| package.subpackage2.__init__ | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| package.subpackage2.__init__ | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| package.subpackage2.__init__ | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| package.subpackage2.__init__ | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| package.subpackage2.__init__ | subpackage2_attr | package/subpackage2/__init__.py:4:20:4:37 | ControlFlowNode for Str |
| package.subpackage.__init__ | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| package.subpackage.__init__ | __file__ | package/subpackage/__init__.py:2:7:2:14 | ControlFlowNode for __file__ |
| package.subpackage.__init__ | __file__ | package/subpackage/__init__.py:14:6:14:13 | ControlFlowNode for __file__ |
| package.subpackage.__init__ | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| package.subpackage.__init__ | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| package.subpackage.__init__ | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| package.subpackage.__init__ | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| package.subpackage.__init__ | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| package.subpackage.__init__ | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| package.subpackage.__init__ | imported_attr | package/subpackage/__init__.py:7:16:7:55 | ControlFlowNode for ImportMember |
| package.subpackage.__init__ | irrelevant_attr | package/subpackage/__init__.py:11:24:11:38 | ControlFlowNode for ImportMember |
| package.subpackage.__init__ | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| package.subpackage.__init__ | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| package.subpackage.__init__ | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| package.subpackage.__init__ | subpackage_attr | package/subpackage/__init__.py:4:19:4:35 | ControlFlowNode for Str |
| package.subpackage.submodule | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| package.subpackage.submodule | __file__ | package/subpackage/submodule.py:2:7:2:14 | ControlFlowNode for __file__ |
| package.subpackage.submodule | __file__ | package/subpackage/submodule.py:7:6:7:13 | ControlFlowNode for __file__ |
| package.subpackage.submodule | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| package.subpackage.submodule | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| package.subpackage.submodule | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| package.subpackage.submodule | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| package.subpackage.submodule | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| package.subpackage.submodule | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| package.subpackage.submodule | irrelevant_attr | package/subpackage/submodule.py:5:19:5:35 | ControlFlowNode for Str |
| package.subpackage.submodule | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| package.subpackage.submodule | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| package.subpackage.submodule | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| package.subpackage.submodule | submodule_attr | package/subpackage/submodule.py:4:18:4:33 | ControlFlowNode for Str |
| refined | SOURCE | refined.py:4:1:4:21 | ControlFlowNode for ClassExpr |
| refined | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| refined | __file__ | refined.py:2:7:2:14 | ControlFlowNode for __file__ |
| refined | __file__ | refined.py:14:6:14:13 | ControlFlowNode for __file__ |
| refined | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| refined | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| refined | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| refined | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| refined | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| refined | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| refined | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| refined | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| refined | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| simplistic_reexport | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| simplistic_reexport | __file__ | baz.py:2:7:2:14 | ControlFlowNode for __file__ |
| simplistic_reexport | __file__ | baz.py:6:6:6:13 | ControlFlowNode for __file__ |
| simplistic_reexport | __file__ | simplistic_reexport.py:4:7:4:14 | ControlFlowNode for __file__ |
| simplistic_reexport | __file__ | simplistic_reexport.py:19:6:19:13 | ControlFlowNode for __file__ |
| simplistic_reexport | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |
| simplistic_reexport | _print | trace.py:5:10:5:14 | ControlFlowNode for print |
| simplistic_reexport | _status | trace.py:21:11:21:11 | ControlFlowNode for IntegerLiteral |
| simplistic_reexport | bar_attr | simplistic_reexport.py:6:17:6:24 | ControlFlowNode for ImportMember |
| simplistic_reexport | bar_attr | simplistic_reexport.py:9:12:9:24 | ControlFlowNode for Str |
| simplistic_reexport | baz_attr | baz.py:4:12:4:21 | ControlFlowNode for Str |
@@ -298,8 +167,6 @@
| simplistic_reexport | check | trace.py:26:1:26:61 | ControlFlowNode for FunctionExpr |
| simplistic_reexport | enter | trace.py:11:1:11:21 | ControlFlowNode for FunctionExpr |
| simplistic_reexport | exit | trace.py:16:1:16:20 | ControlFlowNode for FunctionExpr |
| simplistic_reexport | print | trace.py:7:1:7:27 | ControlFlowNode for FunctionExpr |
| simplistic_reexport | print_function | trace.py:1:24:1:37 | ControlFlowNode for ImportMember |
| simplistic_reexport | status | trace.py:23:1:23:13 | ControlFlowNode for FunctionExpr |
| trace | __all__ | trace.py:52:11:52:46 | ControlFlowNode for List |
| trace | _indent_level | trace.py:3:17:3:17 | ControlFlowNode for IntegerLiteral |

View File

@@ -119,7 +119,7 @@ import has_defined_all_indirection # $ imports=has_defined_all_indirection as=ha
check("has_defined_all_indirection.all_defined_foo_copy", has_defined_all_indirection.all_defined_foo_copy, "all_defined_foo_copy", globals()) #$ prints=all_defined_foo_copy
try:
check("has_defined_all_indirection.all_defined_bar_copy", has_defined_all_indirection.all_defined_bar_copy, "all_defined_bar_copy", globals()) #$ SPURIOUS: prints=all_defined_bar_copy
check("has_defined_all_indirection.all_defined_bar_copy", has_defined_all_indirection.all_defined_bar_copy, "all_defined_bar_copy", globals())
raise Exception("Did not get expected AttributeError")
except AttributeError as e:
if "all_defined_bar_copy" in str(e):