164 @type list of str (optional) |
164 @type list of str (optional) |
165 @return list of found interpreter executables |
165 @return list of found interpreter executables |
166 @rtype list of str |
166 @rtype list of str |
167 """ |
167 """ |
168 try: |
168 try: |
169 import winreg # noqa: I101, I103 |
169 import winreg # noqa: I-101, I-103 |
170 except ImportError: |
170 except ImportError: |
171 import _winreg as winreg # noqa: I101, I102 |
171 import _winreg as winreg # noqa: I-101, I-102 |
172 |
172 |
173 def getExePath(branch, access, versionStr): |
173 def getExePath(branch, access, versionStr): |
174 with contextlib.suppress(WindowsError, OSError): |
174 with contextlib.suppress(WindowsError, OSError): |
175 software = winreg.OpenKey(branch, "Software", 0, access) |
175 software = winreg.OpenKey(branch, "Software", 0, access) |
176 python = winreg.OpenKey(software, "Python", 0, access) |
176 python = winreg.OpenKey(software, "Python", 0, access) |