2525from genshi .util import flatten
2626
2727from genshi .compat import get_code_params , build_code_chunk , isstring , \
28- IS_PYTHON2
28+ IS_PYTHON2 , _ast_Str
2929
3030__all__ = ['Code' , 'Expression' , 'Suite' , 'LenientLookup' , 'StrictLookup' ,
3131 'Undefined' , 'UndefinedError' ]
@@ -531,7 +531,7 @@ def visit_Str(self, node):
531531 try : # If the string is ASCII, return a `str` object
532532 node .s .decode ('ascii' )
533533 except ValueError : # Otherwise return a `unicode` object
534- return _new (_ast . Str , node .s .decode ('utf-8' ))
534+ return _new (_ast_Str , node .s .decode ('utf-8' ))
535535 return node
536536
537537 def visit_ClassDef (self , node ):
@@ -556,7 +556,7 @@ def visit_ImportFrom(self, node):
556556 node = _new (_ast .Expr , _new (_ast .Call ,
557557 _new (_ast .Name , '_star_import_patch' ), [
558558 _new (_ast .Name , '__data__' ),
559- _new (_ast . Str , node .module )
559+ _new (_ast_Str , node .module )
560560 ], (), ()))
561561 return node
562562 if len (self .locals ) > 1 :
@@ -613,7 +613,7 @@ def visit_Name(self, node):
613613 # Otherwise, translate the name ref into a context lookup
614614 name = _new (_ast .Name , '_lookup_name' , _ast .Load ())
615615 namearg = _new (_ast .Name , '__data__' , _ast .Load ())
616- strarg = _new (_ast . Str , node .id )
616+ strarg = _new (_ast_Str , node .id )
617617 node = _new (_ast .Call , name , [namearg , strarg ], [])
618618 elif isinstance (node .ctx , _ast .Store ):
619619 if len (self .locals ) > 1 :
@@ -632,7 +632,7 @@ def visit_Attribute(self, node):
632632 return ASTTransformer .visit_Attribute (self , node )
633633
634634 func = _new (_ast .Name , '_lookup_attr' , _ast .Load ())
635- args = [self .visit (node .value ), _new (_ast . Str , node .attr )]
635+ args = [self .visit (node .value ), _new (_ast_Str , node .attr )]
636636 return _new (_ast .Call , func , args , [])
637637
638638 def visit_Subscript (self , node ):
0 commit comments