Skip to content

Commit

Permalink
Remove sphinx.util.Tee (#12763)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Aug 11, 2024
1 parent daf1e28 commit 629b0ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Dependencies
Incompatible changes
--------------------

* #12763: Remove unused internal class ``sphinx.util.Tee``.
Patch by Adam Turner.

Deprecated
----------

Expand Down
22 changes: 1 addition & 21 deletions sphinx/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import posixpath
import re
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 sphinx.errors import FiletypeNotFoundError
Expand Down Expand Up @@ -164,26 +164,6 @@ def __call__(self, error: UnicodeDecodeError) -> tuple[str, int]:

# 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]:
"""Parse a line number spec (such as "1,2,4-6") and return a list of
wanted line numbers.
Expand Down

0 comments on commit 629b0ae

Please sign in to comment.