Skip to content

Commit

Permalink
EditableText.detectPossibleSelectionChange(): Gracefully handle the c…
Browse files Browse the repository at this point in the history
…ase where initAutoSelectDetection() hasn't yet been called. This isn't supposed to happen, but it might if a gainFocus event failed, etc. We were already guarding _lastSelectionPos, but not hasContentChangedSinceLastSelection. Fixes rare AttributeError exceptions for hasContentChangedSinceLastSelection.
  • Loading branch information
jcsteh committed Jul 16, 2010
1 parent b15eb3d commit 704f778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/editableText.py
Expand Up @@ -177,7 +177,7 @@ def detectPossibleSelectionChange(self):
if not oldInfo:
# There's nothing we can do, but at least the last selection will be right next time.
return
hasContentChanged=self.hasContentChangedSinceLastSelection
hasContentChanged=getattr(self,'hasContentChangedSinceLastSelection',False)
self.hasContentChangedSinceLastSelection=False
speech.speakSelectionChange(oldInfo,newInfo,generalize=hasContentChanged)

Expand Down

0 comments on commit 704f778

Please sign in to comment.