changeset 49809:7a80a614c9e5

windows: drop some py2 registry module importing The comment was actually backwards- `winreg` is importable on py3, and is already imported by mercurial/windows.py.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 15 Dec 2022 15:46:25 -0500
parents 7a4143428db7
children a9faacdc5943
files mercurial/scmwindows.py
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmwindows.py	Thu Dec 15 15:41:59 2022 -0500
+++ b/mercurial/scmwindows.py	Thu Dec 15 15:46:25 2022 -0500
@@ -1,4 +1,5 @@
 import os
+import winreg  # pytype: disable=import-error
 
 from typing import (
     List,
@@ -15,14 +16,6 @@
 if pycompat.TYPE_CHECKING:
     from . import ui as uimod
 
-try:
-    import _winreg as winreg  # pytype: disable=import-error
-
-    winreg.CloseKey
-except ImportError:
-    # py2 only
-    import winreg  # pytype: disable=import-error
-
 # MS-DOS 'more' is the only pager available by default on Windows.
 fallbackpager = b'more'