--- a/src/eric7/Utilities/ClassBrowsers/pyclbr.py Tue Nov 08 16:57:46 2022 +0100 +++ b/src/eric7/Utilities/ClassBrowsers/pyclbr.py Tue Nov 08 18:03:11 2022 +0100 @@ -142,6 +142,13 @@ _modules = {} # cache of modules we've seen +def clearModulesCache(): + """ + Function to clear the cached modules. + """ + _modules.clear() + + class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase): """ Mixin class implementing the notion of visibility. @@ -354,7 +361,7 @@ self.importedNames[name].append(lineno) -def readmodule_ex(module, path=None, inpackage=False, isPyFile=False): +def readmodule_ex(module, path=None, isTypeFile=False): """ Read a module file and return a dictionary of classes. @@ -366,9 +373,7 @@ @type str @param path path the module should be searched in @type list of str - @param inpackage flag indicating a module inside a package is scanned - @type bool - @param isPyFile flag indicating a Python file + @param isTypeFile flag indicating a file of this type @type bool @return the resulting dictionary @rtype dict @@ -386,15 +391,10 @@ # search the path for the module path = [] if path is None else path[:] f = None - if inpackage: - try: - f, file, (suff, mode, type) = ClassBrowsers.find_module(module, path) - except ImportError: - f = None if f is None: fullpath = path[:] + sys.path[:] f, file, (suff, mode, type) = ClassBrowsers.find_module( - module, fullpath, isPyFile + module, fullpath, isTypeFile ) if f: f.close()