src/eric7/PipInterface/PipVulnerabilityChecker.py

branch
eric7
changeset 11148
15e30f0c76a8
parent 11090
f5f5f5803935
equal deleted inserted replaced
11147:dee6e106b4d3 11148:15e30f0c76a8
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: # noqa: Y117 130 with open(self.__cacheFile, "r") as f: # noqa: Y-117
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