windows: drop some py2 compatibility code
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 13 Jun 2022 11:18:41 -0400
changeset 49318 6b39c7265935
parent 49317 709e5f7eec1f
child 49319 a75b530cfc29
windows: drop some py2 compatibility code The comment was wrong- the exception handler was the py3 case.
mercurial/windows.py
--- 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')