eric7/PipInterface/PipVulnerabilityChecker.py

branch
eric7
changeset 9001
a00cd6b55728
parent 8978
38c3ddf21537
child 9052
c06475635841
equal deleted inserted replaced
9000:bc0b38405b6a 9001:a00cd6b55728
25 25
26 from EricWidgets import EricMessageBox 26 from EricWidgets import EricMessageBox
27 27
28 import Globals 28 import Globals
29 import Preferences 29 import Preferences
30
30 31
31 @dataclass 32 @dataclass
32 class Package: 33 class Package:
33 """ 34 """
34 Class containing the package data. 35 Class containing the package data.
123 @type str 124 @type str
124 @return dictionary containing the requested vulnerability data 125 @return dictionary containing the requested vulnerability data
125 @rtype dict 126 @rtype dict
126 """ 127 """
127 if os.path.exists(self.__cacheFile): 128 if os.path.exists(self.__cacheFile):
128 with open(self.__cacheFile, "r") as f: 129 with open(self.__cacheFile, "r") as f: # __IGNORE_WARNING_Y117__
129 with contextlib.suppress(json.JSONDecodeError, OSError): 130 with contextlib.suppress(json.JSONDecodeError, OSError):
130 cachedData = json.load(f) 131 cachedData = json.load(f)
131 if ( 132 if (
132 dbName in cachedData and 133 dbName in cachedData and
133 "cachedAt" in cachedData[dbName] 134 "cachedAt" in cachedData[dbName]

eric ide

mercurial