src/eric7/PipInterface/PipVulnerabilityChecker.py

branch
eric7
changeset 10180
3a595df36c9a
parent 9653
e67609152c5e
child 10373
093dcebe5ecb
equal deleted inserted replaced
10179:c2125fcab4b8 10180:3a595df36c9a
125 @type str 125 @type str
126 @return dictionary containing the requested vulnerability data 126 @return dictionary containing the requested vulnerability data
127 @rtype dict 127 @rtype dict
128 """ 128 """
129 if os.path.exists(self.__cacheFile): 129 if os.path.exists(self.__cacheFile):
130 with open(self.__cacheFile, "r") as f: # __IGNORE_WARNING_Y117__ 130 with open(self.__cacheFile, "r") as f: # noqa: Y117
131 with contextlib.suppress(json.JSONDecodeError, OSError): 131 with contextlib.suppress(json.JSONDecodeError, OSError):
132 cachedData = json.load(f) 132 cachedData = json.load(f)
133 if dbName in cachedData and "cachedAt" in cachedData[dbName]: 133 if dbName in cachedData and "cachedAt" in cachedData[dbName]:
134 cacheValidPeriod = Preferences.getPip( 134 cacheValidPeriod = Preferences.getPip(
135 "VulnerabilityDbCacheValidity" 135 "VulnerabilityDbCacheValidity"

eric ide

mercurial