mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 22:54:14 +00:00 
			
		
		
		
	When switching between Python versions, the database package used to create the cache might be unavailable and an ImportError is raised, such as `ImportError: No module named gdbm`.
This commit is contained in:
		| @@ -228,8 +228,8 @@ def cache(*depends_on): | |||||||
|                     value = fn(*args, **kwargs) |                     value = fn(*args, **kwargs) | ||||||
|                     db[key] = {'etag': etag, 'value': value} |                     db[key] = {'etag': etag, 'value': value} | ||||||
|                     return value |                     return value | ||||||
|         except shelve_open_error: |         except (shelve_open_error, ImportError): | ||||||
|             # Caused when going from Python 2 to Python 3 and vice-versa |             # 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) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user