diff options
author | DonScorgie <DonScorgie@8f060a39-251c-0410-b1f3-431655927647> | 2007-04-17 18:24:09 (GMT) |
---|---|---|
committer | DonScorgie <DonScorgie@8f060a39-251c-0410-b1f3-431655927647> | 2007-04-17 18:24:09 (GMT) |
commit | 8e7f0ef96119363df6c8e466c6c4b323509cdb50 (patch) | |
tree | bd1c7b07177e99e121835683360678cdb4db3d6e /src/TextThought.py | |
parent | 4513c665b6cf4a234457cbc3260e90752cd15146 (diff) |
* src/TextThought.py:
-Later- Fix byte table rebuilding in the presence of "undecipherable"
characters as Python puts it. Basically, add a try-except block to
ensure the character is correctly tested
git-svn-id: http://labyrinth.googlecode.com/svn/trunk@169 8f060a39-251c-0410-b1f3-431655927647
Diffstat (limited to 'src/TextThought.py')
-rw-r--r-- | src/TextThought.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/TextThought.py b/src/TextThought.py index e490dbc..a97aeb7 100644 --- a/src/TextThought.py +++ b/src/TextThought.py @@ -907,11 +907,15 @@ class TextThought (BaseThought.BaseThought): else: blen = 2 while 1: - if str(tmp[current:current+blen].encode()) == str(self.text[z]): - self.bytes += str(blen) - current+=(blen-1) - break - blen += 1 + try: + x = str(tmp[current:current+blen]) + if str(tmp[current:current+blen].encode()) == str(self.text[z]): + self.bytes += str(blen) + current+=(blen-1) + break + blen += 1 + except: + blen += 1 current+=1 self.bindex = self.b_f_i (self.index) self.text = tmp |