Skip to content

Commit 68e62cb

Browse files
committed
undo risky import change, fix lint
1 parent ce2c5f2 commit 68e62cb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

source/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def doStartupDialogs():
8888
gui.mainFrame.onToggleSpeechViewerCommand(evt=None)
8989
import inputCore
9090
if inputCore.manager.userGestureMap.lastUpdateContainedError:
91+
import wx
9192
gui.messageBox(_("Your gesture map file contains errors.\n"
9293
"More details about the errors can be found in the log file."),
9394
_("gesture map File Error"), wx.OK|wx.ICON_EXCLAMATION)
@@ -99,6 +100,7 @@ def doStartupDialogs():
99100
if updateCheck and not config.conf['update']['askedAllowUsageStats']:
100101
# a callback to save config after the usage stats question dialog has been answered.
101102
def onResult(ID):
103+
import wx
102104
if ID in (wx.ID_YES,wx.ID_NO):
103105
try:
104106
config.conf.save()
@@ -110,6 +112,7 @@ def onResult(ID):
110112
def restart(disableAddons=False, debugLogging=False):
111113
"""Restarts NVDA by starting a new copy."""
112114
if globalVars.appArgs.launcher:
115+
import wx
113116
globalVars.exitCode=3
114117
wx.GetApp().ExitMainLoop()
115118
return
@@ -208,7 +211,7 @@ def _setInitialFocus():
208211
log.exception("Error retrieving initial focus")
209212

210213

211-
def getWxLangOrNone() -> Optional['wx.LanguageInfo']:
214+
def getWxLangOrNone() -> Optional[wx.LanguageInfo]:
212215
import languageHandler
213216
import wx
214217
lang = languageHandler.getLanguage()

0 commit comments

Comments
 (0)