<s> import os <EOL> def find_egg_info_dir ( dir ) : <EOL> while <NUM_LIT:1> : <EOL> try : <EOL> filenames = os . listdir ( dir ) <EOL> except OSError : <EOL> return None <EOL> for fn in filenames : <EOL> if ( fn . endswith ( '<STR_LIT>' ) <EOL> and os . path . isdir ( os . path . join ( dir , fn ) ) ) : <EOL> return os . path . join ( dir , fn ) <EOL> parent = os . path . dirname ( dir ) <EOL> if parent == dir : <EOL> return None <EOL> dir = parent </s>
