From 7cee276d551a41d9271daf2a6bcd7def55555973 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 8 Mar 2024 15:42:21 +0300 Subject: [PATCH] gh-116493: Remove old Python 2.x _winreg imports from platform.py (GH-116494) --- Lib/platform.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Lib/platform.py b/Lib/platform.py index 6764e0d5f75063..2756f298f9676f 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -370,10 +370,7 @@ def win32_is_iot(): def win32_edition(): try: - try: - import winreg - except ImportError: - import _winreg as winreg + import winreg except ImportError: pass else: @@ -432,10 +429,7 @@ def _win32_ver(version, csd, ptype): csd = 'SP' + csd[13:] try: - try: - import winreg - except ImportError: - import _winreg as winreg + import winreg except ImportError: pass else: