def find_module(module, paths=None):
parts = module.split('<STR_LIT:.>')<EOL>while parts:<EOL><INDENT>part = parts.pop(<NUM_LIT:0>)<EOL>f, path, (suffix,mode,kind) = info = imp.find_module(part, paths)<EOL>if kind==PKG_DIRECTORY:<EOL><INDENT>parts = parts or ['<STR_LIT>']<EOL>paths = [path]<EOL><DEDENT>elif parts:<EOL><INDENT>raise ImportError("<STR_LIT>" % (parts,module))<EOL><DEDENT><DEDENT>return info<EOL>
Just like 'imp.find_module()', but with package support