'Given a path entry from sys.path which may refer to an importer,
return the appropriate FilePath-like instance.
@param pathName: a str describing the path.
@return: a FilePath-like object.'

def _smartPath(self, pathName):

    importr = self.importerCache.get(pathName, _nothing)
    if (importr is _nothing):
        for hook in self.sysPathHooks:
            try:
                importr = hook(pathName)
            except ImportError:
                pass
        if (importr is _nothing):
            importr = None
    return IPathImportMapper(importr, _theDefaultMapper).mapPath(pathName)
