diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-12-15 13:12:13 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-12-15 17:15:49 +0900 |
commit | 9fc53cecf74fae33ac8509d34eea334ad4193d2b (patch) | |
tree | 330d9f4269b752216684512d90cf99ffae7f2d0f /tests/path.py | |
parent | 108491d49ea37f8e42ad32242167bc8a00f89cd8 (diff) | |
download | sphinx-git-9fc53cecf74fae33ac8509d34eea334ad4193d2b.tar.gz |
Reduce deprecation warnings (refs: #3192)
Diffstat (limited to 'tests/path.py')
-rwxr-xr-x | tests/path.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/path.py b/tests/path.py index 959b54875..ef1f35004 100755 --- a/tests/path.py +++ b/tests/path.py @@ -142,7 +142,8 @@ class path(text_type): """ Returns the text in the file. """ - with open(self, mode='U', encoding=encoding, **kwargs) as f: + mode = 'rU' if PY2 else 'r' + with open(self, mode=mode, encoding=encoding, **kwargs) as f: text = f.read() contents = repr_as(text, '<%s contents>' % self.basename()) return contents |