changeset 49324:6b39c7265935

windows: drop some py2 compatibility code The comment was wrong- the exception handler was the py3 case.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 13 Jun 2022 11:18:41 -0400
parents 709e5f7eec1f
children a75b530cfc29
files mercurial/windows.py
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/windows.py	Mon Jun 13 11:06:33 2022 -0400
+++ b/mercurial/windows.py	Mon Jun 13 11:18:41 2022 -0400
@@ -14,6 +14,7 @@
 import stat
 import string
 import sys
+import winreg  # pytype: disable=import-error
 
 from .i18n import _
 from .pycompat import getattr
@@ -25,13 +26,6 @@
     win32,
 )
 
-try:
-    import _winreg as winreg  # pytype: disable=import-error
-
-    winreg.CloseKey
-except ImportError:
-    # py2 only
-    import winreg  # pytype: disable=import-error
 
 osutil = policy.importmod('osutil')