43 @exception InvalidModulePathError raised to indicate an invalid module path |
43 @exception InvalidModulePathError raised to indicate an invalid module path |
44 """ |
44 """ |
45 (head, tail) = os.path.split(path) |
45 (head, tail) = os.path.split(path) |
46 if head == "" or tail == "": |
46 if head == "" or tail == "": |
47 raise InvalidModulePathError( |
47 raise InvalidModulePathError( |
48 'Invalid python file path: "{0}"' " Missing path or file name".format(path) |
48 'Invalid python file path: "{0}" Missing path or file name'.format(path) |
49 ) |
49 ) |
50 |
50 |
51 qname = [os.path.splitext(tail)[0]] |
51 qname = [os.path.splitext(tail)[0]] |
52 while head not in ["/", ".", ""]: |
52 while head not in ["/", ".", ""]: |
53 if os.path.isfile(os.path.join(head, "__init__.py")): |
53 if os.path.isfile(os.path.join(head, "__init__.py")): |