#NEWLINE# def find_module( modname , path = None ) : #NEWLINE# #INDENT# 'Find a module, also handling subpackages.\n    Similar to imp.find_module(), except works with subpackages.\n    This does not load the module, so no side effects from the module. It\n    does load the package, so any contents of __init__.py are run and may\n    have side effects.\n\n    Returns:\n        fo     -- Open file object.\n        fname  -- file name of the file found\n        desc   -- a 3-tuple of extension, mode, and file type.\n    ' #NEWLINE# if ( '.' in modname ) : #NEWLINE# #INDENT# ( pkgname , modname ) = modname . rsplit ( '.' , 1 ) #NEWLINE# pkg = find_package ( pkgname ) #NEWLINE# return find_module ( modname , pkg . __path__ ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# info = imp . find_module ( modname , path ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return info