未验证 提交 0799ceac 编写于 作者: P Pradyun Gedam 提交者: Pradyun Gedam

Merge pull request #11136 from pradyunsg/fix-upgrade-prompt

上级 ca2d9f41
Fix an incorrect assertion in the logging logic, that prevented the upgrade prompt from being presented.
......@@ -14,7 +14,9 @@ from pip._vendor.rich.console import (
Console,
ConsoleOptions,
ConsoleRenderable,
RenderableType,
RenderResult,
RichCast,
)
from pip._vendor.rich.highlighter import NullHighlighter
from pip._vendor.rich.logging import RichHandler
......@@ -121,7 +123,7 @@ class IndentingFormatter(logging.Formatter):
@dataclass
class IndentedRenderable:
renderable: ConsoleRenderable
renderable: RenderableType
indent: int
def __rich_console__(
......@@ -156,10 +158,10 @@ class RichPipStreamHandler(RichHandler):
if record.msg == "[present-rich] %s" and len(record.args) == 1:
rich_renderable = record.args[0]
assert isinstance(
rich_renderable, ConsoleRenderable
rich_renderable, (ConsoleRenderable, RichCast, str)
), f"{rich_renderable} is not rich-console-renderable"
renderable: ConsoleRenderable = IndentedRenderable(
renderable: RenderableType = IndentedRenderable(
rich_renderable, indent=get_indentation()
)
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册