Skip to content

Commit

Permalink
Speech generator refactor: Fix import order (PR #11055)
Browse files Browse the repository at this point in the history
Rather than importing '_flattenNestedSequences' from speech module, use this attribute from speech module. This resolves a situation where NVDA might do something (such as uninstlaling add-ons) when it isn't fully initialized, as evidenced by attribute error in speech dict handler.

Fixes #11052
  • Loading branch information
josephsl authored Apr 28, 2020
1 parent 0235dfa commit 1abfc38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/sayAllHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Copyright (C) 2006-2017 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html

import weakref
import speech
from speech import _flattenNestedSequences
import synthDriverHandler
from logHandler import log
import config
Expand Down Expand Up @@ -169,7 +169,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
reason=controlTypes.REASON_SAYALL,
useCache=state
)
seq = list(_flattenNestedSequences(speechGen))
seq = list(speech._flattenNestedSequences(speechGen))
seq.insert(0, cb)
# Speak the speech sequence.
spoke = speech.speakWithoutPauses(seq)
Expand Down

0 comments on commit 1abfc38

Please sign in to comment.