<s> import os , sys <EOL> sys . path . insert ( <EOL> <NUM_LIT:0> , <EOL> os . path . normpath ( <EOL> os . path . join ( <EOL> os . path . dirname ( os . path . abspath ( __file__ ) ) , <EOL> "<STR_LIT:..>" <EOL> ) <EOL> ) <EOL> ) <EOL> from test_common import ( <EOL> my_print , <EOL> setup , <EOL> createSearchMode , <EOL> compareWithCPython , <EOL> withPythonPathChange <EOL> ) <EOL> python_version = setup ( needs_io_encoding = True ) <EOL> search_mode = createSearchMode ( ) <EOL> extra_options = os . environ . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for filename in sorted ( os . listdir ( '<STR_LIT:.>' ) ) : <EOL> if not os . path . isdir ( filename ) or filename . endswith ( "<STR_LIT>" ) or filename . endswith ( "<STR_LIT>" ) : <EOL> continue <EOL> filename = os . path . relpath ( filename ) <EOL> expected_errors = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> if python_version < "<STR_LIT>" : <EOL> expected_errors . append ( "<STR_LIT>" ) <EOL> if filename not in expected_errors : <EOL> extra_flags = [ "<STR_LIT>" ] <EOL> else : <EOL> extra_flags = [ "<STR_LIT>" ] <EOL> if filename in ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ) : <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> if filename != "<STR_LIT>" : <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> else : <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> if filename == "<STR_LIT>" : <EOL> os . environ [ "<STR_LIT>" ] = extra_options + "<STR_LIT>" % ( <EOL> os . path . abspath ( filename ) <EOL> ) <EOL> elif filename == "<STR_LIT>" : <EOL> if python_version < '<STR_LIT:3>' : <EOL> os . environ [ "<STR_LIT>" ] = extra_options + "<STR_LIT>" % ( <EOL> os . path . abspath ( filename ) <EOL> ) <EOL> else : <EOL> os . environ [ "<STR_LIT>" ] = extra_options + "<STR_LIT>" % ( <EOL> os . path . abspath ( filename ) <EOL> ) <EOL> extra_flags . append ( "<STR_LIT>" ) <EOL> else : <EOL> os . environ [ "<STR_LIT>" ] = extra_options <EOL> active = search_mode . consider ( <EOL> dirname = None , <EOL> filename = filename <EOL> ) <EOL> if active : <EOL> my_print ( "<STR_LIT>" , filename ) <EOL> for filename_main in os . listdir ( filename ) : <EOL> if filename_main . endswith ( "<STR_LIT>" ) : <EOL> break <EOL> if filename_main . endswith ( "<STR_LIT>" ) : <EOL> break <EOL> else : <EOL> sys . exit ( <EOL> """<STR_LIT>""" % ( <EOL> filename <EOL> ) <EOL> ) <EOL> extra_python_path = [ <EOL> os . path . abspath ( os . path . join ( filename , entry ) ) <EOL> for entry in <EOL> os . listdir ( filename ) <EOL> if entry . startswith ( "<STR_LIT:path>" ) <EOL> ] <EOL> with withPythonPathChange ( extra_python_path ) : <EOL> compareWithCPython ( <EOL> dirname = filename , <EOL> filename = filename_main , <EOL> extra_flags = extra_flags , <EOL> search_mode = search_mode , <EOL> needs_2to3 = False <EOL> ) <EOL> else : <EOL> my_print ( "<STR_LIT>" , filename ) <EOL> search_mode . finish ( ) </s>
