mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove `sphinx.util.Tee
` (#12763)
This commit is contained in:
parent
daf1e28384
commit
629b0aef8c
@ -10,6 +10,9 @@ Dependencies
|
|||||||
Incompatible changes
|
Incompatible changes
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
* #12763: Remove unused internal class ``sphinx.util.Tee``.
|
||||||
|
Patch by Adam Turner.
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import os
|
|||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
from typing import IO, Any
|
from typing import Any
|
||||||
from urllib.parse import parse_qsl, quote_plus, urlencode, urlsplit, urlunsplit
|
from urllib.parse import parse_qsl, quote_plus, urlencode, urlsplit, urlunsplit
|
||||||
|
|
||||||
from sphinx.errors import FiletypeNotFoundError
|
from sphinx.errors import FiletypeNotFoundError
|
||||||
@ -164,26 +164,6 @@ class UnicodeDecodeErrorHandler:
|
|||||||
|
|
||||||
# Low-level utility functions and classes.
|
# Low-level utility functions and classes.
|
||||||
|
|
||||||
class Tee:
|
|
||||||
"""
|
|
||||||
File-like object writing to two streams.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, stream1: IO, stream2: IO) -> None:
|
|
||||||
self.stream1 = stream1
|
|
||||||
self.stream2 = stream2
|
|
||||||
|
|
||||||
def write(self, text: str) -> None:
|
|
||||||
self.stream1.write(text)
|
|
||||||
self.stream2.write(text)
|
|
||||||
|
|
||||||
def flush(self) -> None:
|
|
||||||
if hasattr(self.stream1, 'flush'):
|
|
||||||
self.stream1.flush()
|
|
||||||
if hasattr(self.stream2, 'flush'):
|
|
||||||
self.stream2.flush()
|
|
||||||
|
|
||||||
|
|
||||||
def parselinenos(spec: str, total: int) -> list[int]:
|
def parselinenos(spec: str, total: int) -> list[int]:
|
||||||
"""Parse a line number spec (such as "1,2,4-6") and return a list of
|
"""Parse a line number spec (such as "1,2,4-6") and return a list of
|
||||||
wanted line numbers.
|
wanted line numbers.
|
||||||
|
Loading…
Reference in New Issue
Block a user