<s> """<STR_LIT>""" <EOL> from . . pgen2 import token <EOL> from . . import fixer_base <EOL> from . . fixer_util import Name , Call , ListComp , in_special_context <EOL> from . . pygram import python_symbols as syms <EOL> class FixMap ( fixer_base . ConditionalFix ) : <EOL> BM_compatible = True <EOL> PATTERN = """<STR_LIT>""" <EOL> skip_on = '<STR_LIT>' <EOL> def transform ( self , node , results ) : <EOL> if self . should_skip ( node ) : <EOL> return <EOL> if node . parent . type == syms . simple_stmt : <EOL> self . warning ( node , "<STR_LIT>" ) <EOL> new = node . clone ( ) <EOL> new . prefix = "<STR_LIT>" <EOL> new = Call ( Name ( "<STR_LIT:list>" ) , [ new ] ) <EOL> elif "<STR_LIT>" in results : <EOL> new = ListComp ( results [ "<STR_LIT>" ] . clone ( ) , <EOL> results [ "<STR_LIT>" ] . clone ( ) , <EOL> results [ "<STR_LIT>" ] . clone ( ) ) <EOL> else : <EOL> if "<STR_LIT>" in results : <EOL> new = results [ "<STR_LIT>" ] . clone ( ) <EOL> else : <EOL> if "<STR_LIT>" in results : <EOL> args = results [ "<STR_LIT>" ] <EOL> if args . type == syms . arglist and args . children [ <NUM_LIT:0> ] . type == token . NAME and args . children [ <NUM_LIT:0> ] . value == "<STR_LIT:None>" : <EOL> self . warning ( node , "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> return <EOL> if in_special_context ( node ) : <EOL> return None <EOL> new = node . clone ( ) <EOL> new . prefix = "<STR_LIT>" <EOL> new = Call ( Name ( "<STR_LIT:list>" ) , [ new ] ) <EOL> new . prefix = node . prefix <EOL> return new </s>
