def _iter_module_files():
 for module in list(sys.modules.values()):
  if (module is None):
   continue
  filename = getattr(module, '__file__', None)
  if filename:
   old = None
   while (not os.path.isfile(filename)):
    old = filename
    filename = os.path.dirname(filename)
    if (filename == old):
     break
   else:
    if (filename[(-4):] in ('.pyc', '.pyo')):
     filename = filename[:(-1)]
    (yield filename)

def _iter_module_files ( ) : for module in list ( sys . modules . values ( ) ) : if ( module is None ) : continue filename = getattr ( module , '__file__' , None ) if filename : old = None while ( not os . path . isfile ( filename ) ) : old = filename filename = os . path . dirname ( filename ) if ( filename == old ) : break else : if ( filename [ ( - 4 ) : ] in ( '.pyc' , '.pyo' ) ) : filename = filename [ : ( - 1 ) ] ( yield filename )
this iterates over all relevant python files .