fix(linux): Fix attribute error

Newer versions of requests-cache (>= 0.6) restructure some code so
that the _core_ namespace is no longer available. However, it turns
out that we don't need to specify that namespace at all, so this
change will work with both older and newer versions of
requests-cache.

This will fix #6085.

(cherry picked from commit 254ceabe78)
This commit is contained in:
Eberhard Beilharz 2022-01-07 17:22:53 +01:00
parent c417efabca
commit 9f9cfc995c
No known key found for this signature in database
GPG key ID: E9140597606020D3

View file

@ -34,7 +34,7 @@ def get_package_download_data(packageID, weekCache=False):
response = requests.get(api_url)
logging.debug("Time: {0} / Used Cache: {1}".format(now, response.from_cache))
os.chdir(current_dir)
requests_cache.core.uninstall_cache()
requests_cache.uninstall_cache()
if response.status_code == 200:
return response.json()
else:
@ -66,7 +66,7 @@ def get_keyboard_data(keyboardID, weekCache=False):
response = requests.get(api_url)
logging.debug("Time: {0} / Used Cache: {1}".format(now, response.from_cache))
os.chdir(current_dir)
requests_cache.core.uninstall_cache()
requests_cache.uninstall_cache()
if response.status_code == 200:
return response.json()
else:
@ -168,7 +168,7 @@ def download_kmp_file(url, kmpfile, cache=False):
if cache:
logging.debug("Time: {0} / Used Cache: {1}".format(now, response.from_cache))
os.chdir(current_dir)
requests_cache.core.uninstall_cache()
requests_cache.uninstall_cache()
if response.status_code == 200:
with open(kmpfile, 'wb') as f: