diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-07-11 02:40:26 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-07-11 02:40:26 -0400 |
commit | 969dab29bbaed194edce881d60643f5e95a02366 (patch) | |
tree | 5db01e9916dde5da64db004a6b063e406a545da2 /cmd2/utils.py | |
parent | 6ddb6842e5ac87fb5c433eb8d86df48f3e045da2 (diff) | |
download | cmd2-git-969dab29bbaed194edce881d60643f5e95a02366.tar.gz |
Added --clear argument to history command
Added better error checking when loading readline history file
Improved some error messages
Changed IOError usages to OSError since they were merged in Python 3.3.
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index 11d48b78..ff8e034e 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -143,7 +143,7 @@ def is_text_file(file_path: str) -> bool: # noinspection PyUnusedLocal if sum(1 for line in f) > 0: valid_text_file = True - except IOError: # pragma: no cover + except OSError: # pragma: no cover pass except UnicodeDecodeError: # The file is not ASCII. Check if it is UTF-8. @@ -153,7 +153,7 @@ def is_text_file(file_path: str) -> bool: # noinspection PyUnusedLocal if sum(1 for line in f) > 0: valid_text_file = True - except IOError: # pragma: no cover + except OSError: # pragma: no cover pass except UnicodeDecodeError: # Not UTF-8 |