summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py4
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