Skip to content

Commit 165ecc9

Browse files
committed
pythongh-118761: Fix star-import of ast
1 parent 643dd51 commit 165ecc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/ast.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,9 @@ def main():
653653
main()
654654

655655
def __dir__():
656-
dir_ = {n for n in globals() if not n.startswith('_') and n != 'sys'}
657-
return sorted(dir_ | {'unparse'})
656+
return {n for n in globals() if not n.startswith('_')} | {'unparse'}
657+
658+
__all__ = tuple(__dir__() - {'sys'}) # don't include modules in __all__
658659

659660
def __getattr__(name):
660661
if name == 'unparse':

0 commit comments

Comments
 (0)