~pyreadline/pyreadline/trunk

« back to all changes in this revision

Viewing changes to pyreadline/lineeditor/history.py

  • Committer: Jorgen Stenarson
  • Date: 2011-10-06 19:02:52 UTC
  • mfrom: (100.1.19 python3)
  • Revision ID: jorgen.stenarson@bostream.nu-20111006190252-efh961vx5qbcohom
Merging python3 fixes from Shimizukawa

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
import lineobj
17
17
 
18
 
import exceptions
19
 
 
20
 
class EscapeHistory(exceptions.Exception):
 
18
class EscapeHistory(Exception):
21
19
    pass
22
20
 
23
21
from pyreadline.logger import log
93
91
        fp = open(filename, u'wb')
94
92
        for line in self.history[-self.history_length:]:
95
93
            fp.write(ensure_str(line.get_line_text()))
96
 
            fp.write(u'\n')
 
94
            fp.write('\n'.encode('ascii'))
97
95
        fp.close()
98
96
 
99
97