Skip to content

Commit 460491e

Browse files
committed
Add private unparse names to getattr
1 parent dc95d19 commit 460491e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/ast.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,4 +659,10 @@ def __getattr__(name):
659659
from _ast_unparse import unparse
660660
return unparse
661661

662+
if name in {'_INFSTR', '_SINGLE_QUOTES', '_MULTI_QUOTES', '_ALL_QUOTES',
663+
'_Precedence', '_Unparser'}:
664+
# all of these names are private, but re-exported for compatibility
665+
import _ast_unparse
666+
return getattr(_ast_unparse, name)
667+
662668
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

0 commit comments

Comments
 (0)