summaryrefslogtreecommitdiff
path: root/sphinx/directives/code.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r--sphinx/directives/code.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index c6816178c..c2acf8cca 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -219,8 +219,8 @@ class LiteralIncludeReader:
text = text.expandtabs(self.options['tab-width'])
return text.splitlines(True)
- except (IOError, OSError):
- raise IOError(__('Include file %r not found or reading it failed') % filename)
+ except OSError:
+ raise OSError(__('Include file %r not found or reading it failed') % filename)
except UnicodeError:
raise UnicodeError(__('Encoding %r used for reading included file %r seems to '
'be wrong, try giving an :encoding: option') %