--- a/src/eric7/Utilities/ModuleParser.py Mon Feb 19 19:37:00 2024 +0100 +++ b/src/eric7/Utilities/ModuleParser.py Thu Feb 22 16:26:46 2024 +0100 @@ -1679,6 +1679,7 @@ @return reference to a Module object containing the parsed module information @rtype Module + @exception ImportError raised to indicate an unsupported source code type """ global _modules @@ -1689,7 +1690,9 @@ isRemoteFileName = FileSystemUtilities.isRemoteFileName(module) if isRemoteFileName: - fsInterface = ericApp().getObject("EricServer").getServiceInterface("FileSystem") + fsInterface = ( + ericApp().getObject("EricServer").getServiceInterface("FileSystem") + ) module, extension = fsInterface.splitext(fsInterface.basename(module)) else: with contextlib.suppress(ValueError): @@ -1740,7 +1743,7 @@ moduleType = PTL_SOURCE elif extension == ".rb": moduleType = RB_SOURCE - elif extension in _extensions: + elif extension in _extensions: # noqa: Y106 moduleType = PY_SOURCE else: raise ImportError @@ -1777,15 +1780,14 @@ mod = Module(modname, file, moduleType) with contextlib.suppress(UnicodeError, OSError): - if isRemoteFileName: - src = ( - ericApp() - .getObject("EricServer") - .getServiceInterface("FileSystem") - .readEncodedFile(file)[0] - ) - else: - src = Utilities.readEncodedFile(file)[0] + src = ( + ericApp() + .getObject("EricServer") + .getServiceInterface("FileSystem") + .readEncodedFile(file)[0] + if isRemoteFileName + else Utilities.readEncodedFile(file)[0] + ) mod.scan(src) if caching: _modules[modname] = mod