File tree 2 files changed +4
-18
lines changed
2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -2041,12 +2041,10 @@ def visit_import_all(self, i: ImportAll) -> None:
2041
2041
if self .process_import_over_existing_name (
2042
2042
name , existing_symbol , node , i ):
2043
2043
continue
2044
- # In stub files, `from x import *` always reexports the symbols.
2045
- # In regular files, only if implicit reexports are enabled.
2046
- module_public = self .is_stub_file or self .options .implicit_reexport
2044
+ # `from x import *` always reexports symbols
2047
2045
self .add_imported_symbol (name , node , i ,
2048
- module_public = module_public ,
2049
- module_hidden = not module_public )
2046
+ module_public = True ,
2047
+ module_hidden = False )
2050
2048
2051
2049
else :
2052
2050
# Don't add any dummy symbols for 'from x import *' if 'x' is unknown.
Original file line number Diff line number Diff line change @@ -1562,17 +1562,7 @@ __all__ = ('b',)
1562
1562
[out]
1563
1563
main:2: error: Module "other_module_2" does not explicitly export attribute "a"; implicit reexport disabled
1564
1564
1565
- [case testNoImplicitReexportStarConsideredImplicit]
1566
- # flags: --no-implicit-reexport
1567
- from other_module_2 import a
1568
- [file other_module_1.py]
1569
- a = 5
1570
- [file other_module_2.py]
1571
- from other_module_1 import *
1572
- [out]
1573
- main:2: error: Module "other_module_2" does not explicitly export attribute "a"; implicit reexport disabled
1574
-
1575
- [case testNoImplicitReexportStarCanBeReexportedWithAll]
1565
+ [case testNoImplicitReexportStarConsideredExplicit]
1576
1566
# flags: --no-implicit-reexport
1577
1567
from other_module_2 import a
1578
1568
from other_module_2 import b
@@ -1583,8 +1573,6 @@ b = 6
1583
1573
from other_module_1 import *
1584
1574
__all__ = ('b',)
1585
1575
[builtins fixtures/tuple.pyi]
1586
- [out]
1587
- main:2: error: Module "other_module_2" does not explicitly export attribute "a"; implicit reexport disabled
1588
1576
1589
1577
[case testNoImplicitReexportGetAttr]
1590
1578
# flags: --no-implicit-reexport --python-version 3.7
You can’t perform that action at this time.
0 commit comments