def fix_pyext(mod_path):
 if (mod_path[(-4):] in ['.pyo', 'pyc']):
  mod_path = mod_path[:(-1)]
 return mod_path

def fix_pyext ( mod_path ) : if ( mod_path [ ( - 4 ) : ] in [ '.pyo' , 'pyc' ] ) : mod_path = mod_path [ : ( - 1 ) ] return mod_path
fix a module filename path extension to always end with the modules source file .