mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-40459: Fix NameError in platform.py (GH-19855)
This commit is contained in:
parent
92a98ed975
commit
1e7e4519a8
2 changed files with 4 additions and 3 deletions
|
@ -398,9 +398,9 @@ def win32_ver(release='', version='', csd='', ptype=''):
|
|||
else:
|
||||
try:
|
||||
cvkey = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
|
||||
with winreg.OpenKeyEx(HKEY_LOCAL_MACHINE, cvkey) as key:
|
||||
ptype = QueryValueEx(key, 'CurrentType')[0]
|
||||
except:
|
||||
with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, cvkey) as key:
|
||||
ptype = winreg.QueryValueEx(key, 'CurrentType')[0]
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
return release, version, csd, ptype
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue