diff options
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | 2020-05-05 02:33:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 02:33:17 (GMT) |
commit | 1e7e4519a8ddc2239101a0146d788c9161143a77 (patch) | |
tree | efee1427e032197860c644275a86fc768ee473c7 /Lib/platform.py | |
parent | 92a98ed97513c6e365ce8765550ea65d0ddc8cd7 (diff) | |
download | cpython-1e7e4519a8ddc2239101a0146d788c9161143a77.zip cpython-1e7e4519a8ddc2239101a0146d788c9161143a77.tar.gz cpython-1e7e4519a8ddc2239101a0146d788c9161143a77.tar.bz2 |
bpo-40459: Fix NameError in platform.py (GH-19855)
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 3f442ef..049c2c6 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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 |