File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -181,17 +181,21 @@ def readline(self):
181181 only one I've done anything with. The others are just there in case
182182 someone does something weird to stop it from blowing up."""
183183
184+ curses .raw (True )
184185 buffer = ''
185- while True :
186- key = self .interface .get_key ()
187- sys .stdout .write (key )
186+ try :
187+ while True :
188+ key = self .interface .get_key ()
189+ sys .stdout .write (key )
188190# Include the \n in the buffer - raw_input() seems to deal with trailing
189191# linebreaks and will break if it gets an empty string.
190- buffer += key
191- if key == '\n ' :
192- break
192+ buffer += key
193+ if key == '\n ' :
194+ break
195+ finally :
196+ curses .raw (False )
193197
194- return buffer
198+ return buffer . encode ( getpreferredencoding ())
195199
196200 def read (self , x ):
197201 pass
You can’t perform that action at this time.
0 commit comments