From 5b2bf19685d617cb4512e43f3ae23c8948b1554d Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 15 Dec 2018 11:47:08 -0800 Subject: [PATCH] Remove unnecessary bytes type check from path.write_text() All code passes type str to the method. Per the type signature, only str is allowed. --- sphinx/testing/path.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index 77df1ab9b..56ae27f72 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -152,8 +152,6 @@ class path(text_type): """ Writes the given `text` to the file. """ - if isinstance(text, bytes): - text = text.decode(encoding) with open(self, 'w', encoding=encoding, **kwargs) as f: f.write(text)