mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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.
This commit is contained in:
parent
6113261948
commit
5b2bf19685
@ -152,8 +152,6 @@ class path(text_type):
|
|||||||
"""
|
"""
|
||||||
Writes the given `text` to the file.
|
Writes the given `text` to the file.
|
||||||
"""
|
"""
|
||||||
if isinstance(text, bytes):
|
|
||||||
text = text.decode(encoding)
|
|
||||||
with open(self, 'w', encoding=encoding, **kwargs) as f:
|
with open(self, 'w', encoding=encoding, **kwargs) as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user