Skip to content

Commit

Permalink
bpo-40459: Fix NameError in platform.py (GH-19855)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1e7e451)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
  • Loading branch information
miss-islington and sweeneyde authored May 5, 2020
1 parent 4eec39a commit 8ddf915
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:func:`platform.win32_ver` now produces correct *ptype* strings instead of empty strings.

0 comments on commit 8ddf915

Please sign in to comment.