From 41ff7d5f02af7f5cdbb01a940aceea1a4ee44aa4 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 8 Dec 2024 19:28:07 +0300 Subject: [PATCH] markdown: Replace IOError with OSError --- markups/markdown.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markups/markdown.py b/markups/markdown.py index 8d3d9a8..b0ac666 100644 --- a/markups/markdown.py +++ b/markups/markdown.py @@ -111,7 +111,7 @@ def _load_extensions_list_from_yaml_file( except yaml.YAMLError as ex: warnings.warn( f'Failed parsing {filename}: {ex}', SyntaxWarning) - raise IOError from ex + raise OSError from ex if isinstance(data, list): for item in data: if isinstance(item, dict): @@ -137,7 +137,7 @@ def _get_global_extensions( yield from self._load_extensions_list_from_txt_file(choice) else: yield from self._load_extensions_list_from_yaml_file(choice) - except IOError: + except OSError: continue # Cannot open file, move to the next choice else: break # File loaded successfully, skip the remaining choices