diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-26 17:27:46 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-26 17:49:39 +0100 |
commit | 7576dc2719a65c72319d6e453372632e2729e907 (patch) | |
tree | 71383d071c3b6b7d5f1734dc991338aab59edadd /qutebrowser | |
parent | a5063283dee2da81c44e440d308e078242412f49 (diff) | |
download | qutebrowser-7576dc2719a65c72319d6e453372632e2729e907.tar.gz qutebrowser-7576dc2719a65c72319d6e453372632e2729e907.zip |
Get rid of IOError
It's an alias to OSError since Python 3.3:
https://docs.python.org/3/library/exceptions.html
https://www.python.org/dev/peps/pep-3151/
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/browser/hints.py | 2 | ||||
-rw-r--r-- | qutebrowser/misc/lineparser.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 4bf093646..f94e28157 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -1071,7 +1071,7 @@ class WordHinter: hints.discard(word[:i + 1]) hints.add(word) self.words.update(hints) - except IOError as e: + except OSError as e: error = "Word hints requires reading the file at {}: {}" raise HintingError(error.format(dictionary, str(e))) diff --git a/qutebrowser/misc/lineparser.py b/qutebrowser/misc/lineparser.py index 60da6b895..9d35692e9 100644 --- a/qutebrowser/misc/lineparser.py +++ b/qutebrowser/misc/lineparser.py @@ -88,14 +88,14 @@ class BaseLineParser(QObject): mode: The mode to use ('a'/'r'/'w') Raises: - IOError: if the file is already open + OSError: if the file is already open Yields: a file object for the config file """ assert self._configfile is not None if self._opened: - raise IOError("Refusing to double-open LineParser.") + raise OSError("Refusing to double-open LineParser.") self._opened = True try: if self._binary: @@ -172,7 +172,7 @@ class LineParser(BaseLineParser): def save(self): """Save the config file.""" if self._opened: - raise IOError("Refusing to double-open LineParser.") + raise OSError("Refusing to double-open LineParser.") do_save = self._prepare_save() if not do_save: return |