@@ -764,7 +764,7 @@ def runcode(self, code):
764764
765765 def write (self , s ):
766766 "Override base class method"
767- self .tkconsole .stderr .write (s )
767+ return self .tkconsole .stderr .write (s )
768768
769769 def display_port_binding_error (self ):
770770 tkMessageBox .showerror (
@@ -1245,7 +1245,7 @@ def write(self, s, tags=()):
12451245 'Non-BMP character not supported in Tk' )
12461246 try :
12471247 self .text .mark_gravity ("iomark" , "right" )
1248- OutputWindow .write (self , s , tags , "iomark" )
1248+ count = OutputWindow .write (self , s , tags , "iomark" )
12491249 self .text .mark_gravity ("iomark" , "left" )
12501250 except :
12511251 raise ###pass # ### 11Aug07 KBK if we are expecting exceptions
@@ -1254,6 +1254,7 @@ def write(self, s, tags=()):
12541254 self .canceled = 0
12551255 if not use_subprocess :
12561256 raise KeyboardInterrupt
1257+ return count
12571258
12581259class PseudoFile (object ):
12591260
@@ -1265,7 +1266,7 @@ def __init__(self, shell, tags, encoding=None):
12651266 def write (self , s ):
12661267 if not isinstance (s , str ):
12671268 raise TypeError ('must be str, not ' + type (s ).__name__ )
1268- self .shell .write (s , self .tags )
1269+ return self .shell .write (s , self .tags )
12691270
12701271 def writelines (self , lines ):
12711272 for line in lines :
0 commit comments