@@ -81,12 +81,12 @@ def _lookupKeyboardLayoutNameWithHexString(layoutString):
8181 buf = create_unicode_buffer (1024 )
8282 bufSize = c_int (2048 )
8383 key = HKEY ()
84- if windll .advapi32 .RegOpenKeyExW (winreg .HKEY_LOCAL_MACHINE ,u "SYSTEM\\ CurrentControlSet\\ Control\\ Keyboard Layouts\\ "+ layoutString ,0 ,winreg .KEY_QUERY_VALUE ,byref (key ))== 0 :
84+ if windll .advapi32 .RegOpenKeyExW (winreg .HKEY_LOCAL_MACHINE ,"SYSTEM\\ CurrentControlSet\\ Control\\ Keyboard Layouts\\ " + layoutString ,0 ,winreg .KEY_QUERY_VALUE ,byref (key ))== 0 :
8585 try :
86- if windll .advapi32 .RegQueryValueExW (key ,u "Layout Display Name" ,0 ,None ,buf ,byref (bufSize ))== 0 :
86+ if windll .advapi32 .RegQueryValueExW (key ,"Layout Display Name" ,0 ,None ,buf ,byref (bufSize ))== 0 :
8787 windll .shlwapi .SHLoadIndirectString (buf .value ,buf ,1023 ,None )
8888 return buf .value
89- if windll .advapi32 .RegQueryValueExW (key ,u "Layout Text" ,0 ,None ,buf ,byref (bufSize ))== 0 :
89+ if windll .advapi32 .RegQueryValueExW (key ,"Layout Text" ,0 ,None ,buf ,byref (bufSize ))== 0 :
9090 return buf .value
9191 finally :
9292 windll .advapi32 .RegCloseKey (key )
@@ -147,7 +147,7 @@ def handleInputCompositionEnd(result):
147147 from NVDAObjects .inputComposition import InputComposition
148148 from NVDAObjects .IAccessible .mscandui import ModernCandidateUICandidateItem
149149 focus = api .getFocusObject ()
150- result = result .lstrip (u '\u3000 ' )
150+ result = result .lstrip ('\u3000 ' )
151151 curInputComposition = None
152152 if isinstance (focus ,InputComposition ):
153153 curInputComposition = focus
@@ -176,7 +176,7 @@ def handleInputCompositionEnd(result):
176176 speech .speechMode = oldSpeechMode
177177
178178 if curInputComposition and not result :
179- result = curInputComposition .compositionString .lstrip (u '\u3000 ' )
179+ result = curInputComposition .compositionString .lstrip ('\u3000 ' )
180180 if result :
181181 speech .speakText (result ,symbolLevel = characterProcessing .SYMLVL_ALL )
182182
@@ -386,7 +386,7 @@ def nvdaControllerInternal_inputLangChangeNotify(threadID,hkl,layoutString):
386386 inputMethodName = "" .join (inputMethodName .split (' - ' )[1 :])
387387 #Include the language only if it changed.
388388 if languageID != lastLanguageID :
389- msg = u"{language } - {layout}" . format ( language = inputLanguageName , layout = inputMethodName )
389+ msg = f" { inputLanguageName } - { inputMethodName } "
390390 else :
391391 msg = inputMethodName
392392 lastLanguageID = languageID
@@ -418,7 +418,7 @@ def nvdaControllerInternal_installAddonPackageFromPath(addonPath):
418418 wx .CallAfter (addonGui .handleRemoteAddonInstall , addonPath )
419419 return 0
420420
421- class RemoteLoader64 ( object ) :
421+ class RemoteLoader64 :
422422
423423 def __init__ (self ):
424424 # Create a pipe so we can write to stdin of the loader process.
@@ -438,7 +438,7 @@ def __init__(self):
438438 # Therefore, explicitly specify our own process token, which causes them to be inherited.
439439 token = winKernel .OpenProcessToken (winKernel .GetCurrentProcess (), winKernel .MAXIMUM_ALLOWED )
440440 try :
441- winKernel .CreateProcessAsUser (token , None , os .path .join (versionedLib64Path ,u "nvdaHelperRemoteLoader.exe" ), None , None , True , None , None , None , si , pi )
441+ winKernel .CreateProcessAsUser (token , None , os .path .join (versionedLib64Path ,"nvdaHelperRemoteLoader.exe" ), None , None , True , None , None , None , si , pi )
442442 # We don't need the thread handle.
443443 winKernel .closeHandle (pi .hThread )
444444 self ._process = pi .hProcess
@@ -505,7 +505,7 @@ def initialize():
505505 log .info ("Remote injection disabled due to running as a Windows Store Application" )
506506 return
507507 #Load nvdaHelperRemote.dll but with an altered search path so it can pick up other dlls in lib
508- h = windll .kernel32 .LoadLibraryExW (os .path .abspath (os .path .join (versionedLibPath ,u "nvdaHelperRemote.dll" )),0 ,0x8 )
508+ h = windll .kernel32 .LoadLibraryExW (os .path .abspath (os .path .join (versionedLibPath ,"nvdaHelperRemote.dll" )),0 ,0x8 )
509509 if not h :
510510 log .critical ("Error loading nvdaHelperRemote.dll: %s" % WinError ())
511511 return
0 commit comments