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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy