summaryrefslogtreecommitdiff
path: root/sphinx/directives/code.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-15 20:38:46 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-19 19:26:50 +0900
commitd0f5862597c1b4fd5210433a323be6b21d99d1ee (patch)
tree44c13629c970e84c24bb9413d728a8ed75a487c1 /sphinx/directives/code.py
parent3905cb8b7cb92815a6ee41a7d25ad2eaa5b8a443 (diff)
downloadsphinx-git-d0f5862597c1b4fd5210433a323be6b21d99d1ee.tar.gz
Replace EnvironmentError and IOError by OSError
Since python 3.3, EnvironmentError and IOError were merged into OSError.
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') %