mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 22:54:14 +00:00 
			
		
		
		
	#428: Don't fail when history is readonly
This commit is contained in:
		| @@ -10,13 +10,14 @@ from time import time | |||||||
| import io | import io | ||||||
| import os | import os | ||||||
| import shlex | import shlex | ||||||
|  | import sys | ||||||
| import six | import six | ||||||
| from .utils import DEVNULL, memoize, cache | from .utils import DEVNULL, memoize, cache | ||||||
| from .conf import settings | from .conf import settings | ||||||
|  | from . import logs | ||||||
|  |  | ||||||
|  |  | ||||||
| class Generic(object): | class Generic(object): | ||||||
|  |  | ||||||
|     def get_aliases(self): |     def get_aliases(self): | ||||||
|         return {} |         return {} | ||||||
|  |  | ||||||
| @@ -139,7 +140,6 @@ class Bash(Generic): | |||||||
|  |  | ||||||
|  |  | ||||||
| class Fish(Generic): | class Fish(Generic): | ||||||
|  |  | ||||||
|     def _get_overridden_aliases(self): |     def _get_overridden_aliases(self): | ||||||
|         overridden_aliases = os.environ.get('TF_OVERRIDDEN_ALIASES', '').strip() |         overridden_aliases = os.environ.get('TF_OVERRIDDEN_ALIASES', '').strip() | ||||||
|         if overridden_aliases: |         if overridden_aliases: | ||||||
| @@ -303,7 +303,10 @@ def thefuck_alias(): | |||||||
|  |  | ||||||
|  |  | ||||||
| def put_to_history(command): | def put_to_history(command): | ||||||
|  |     try: | ||||||
|         return _get_shell().put_to_history(command) |         return _get_shell().put_to_history(command) | ||||||
|  |     except IOError: | ||||||
|  |         logs.exception("Can't update history", sys.exc_info()) | ||||||
|  |  | ||||||
|  |  | ||||||
| def and_(*commands): | def and_(*commands): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user