Fix for Python 2.5

This commit is contained in:
Thomas Nagy 2014-09-28 22:01:46 +02:00
parent a3942d386b
commit 05d117bad8
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,10 @@ except ImportError:
class AnsiTerm(object):
def __init__(self, stream):
self.stream = stream
self.errors = self.stream.errors
try:
self.errors = self.stream.errors
except AttributeError:
pass # python 2.5
self.encoding = self.stream.encoding
def write(self, txt):
@ -87,7 +90,10 @@ else:
"""
def __init__(self, s):
self.stream = s
self.errors = s.errors
try:
self.errors = s.errors
except AttributeError:
pass # python2.5
self.encoding = s.encoding
self.cursor_history = []