File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,9 @@ def char(self):
250
250
EOF when EOF is reached.
251
251
"""
252
252
if self .ungetBuffer :
253
- return self .ungetBuffer .pop ()
253
+ char = self .ungetBuffer .pop ()
254
+ self .readChars .append (char )
255
+ return char
254
256
255
257
if self .chunkOffset >= len (self .chunk ):
256
258
if not self .readChunk ():
Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ def test_position(self):
60
60
self .assertEquals (stream .position (), (1 , 0 ))
61
61
self .assertEquals (stream .charsUntil ('c' ),u"a\n bb\n " )
62
62
self .assertEquals (stream .position (), (3 , 0 ))
63
- self .assertEquals (stream .charsUntil ('e' ),u"ccc\n ddd" )
63
+ stream .unget ("\n " )
64
+ self .assertEquals (stream .char (), u"\n " )
65
+ self .assertEquals (stream .position (), (3 , 0 ))
66
+ self .assertEquals (stream .charsUntil ('e' ),u"ccc\n ddd" )
64
67
self .assertEquals (stream .position (), (4 , 3 ))
65
68
66
69
def buildTestSuite ():
You can’t perform that action at this time.
0 commit comments