mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 02:01:13 +00:00
#708: Fix handling of shelve errors
This commit is contained in:
parent
d228091beb
commit
21a916d953
@ -195,7 +195,7 @@ class Cache(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self._db = shelve.open(cache_path)
|
self._db = shelve.open(cache_path)
|
||||||
except (shelve_open_error, ImportError):
|
except shelve_open_error + (ImportError,):
|
||||||
# Caused when switching between Python versions
|
# Caused when switching between Python versions
|
||||||
warn("Removing possibly out-dated cache")
|
warn("Removing possibly out-dated cache")
|
||||||
os.remove(cache_path)
|
os.remove(cache_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user