File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -583,13 +583,13 @@ def __init__(self, stream: IO[str]) -> None:
583
583
self .stream = stream
584
584
self .encoding = getattr (stream , 'encoding' , 'ascii' ) or 'ascii'
585
585
586
- def write (self , data : str ) -> None :
586
+ def write (self , data : str ) -> int :
587
587
try :
588
- self .stream .write (data )
588
+ return self .stream .write (data )
589
589
except UnicodeEncodeError :
590
590
# stream accept only str, not bytes. So, we encode and replace
591
591
# non-encodable characters, then decode them.
592
- self .stream .write (
592
+ return self .stream .write (
593
593
data .encode (self .encoding , 'replace' ).decode (self .encoding )
594
594
)
595
595
@@ -604,8 +604,9 @@ class LastMessagesWriter:
604
604
def __init__ (self , app : Sphinx , stream : IO [str ]) -> None :
605
605
self .app = app
606
606
607
- def write (self , data : str ) -> None :
607
+ def write (self , data : str ) -> int :
608
608
self .app .messagelog .append (data )
609
+ return len (data )
609
610
610
611
611
612
def setup (app : Sphinx , status : IO [str ], warning : IO [str ]) -> None :
You can’t perform that action at this time.
0 commit comments