# HG changeset patch # User Matt Harbison # Date 2022-12-15 20:46:25 # Node ID 7a80a614c9e5ded6c6bdc1bf9a832a9b1c7ae00d # Parent 7a4143428db785ab2c5dff9b8d58a257103d532c 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. diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py --- a/mercurial/scmwindows.py +++ b/mercurial/scmwindows.py @@ -1,4 +1,5 @@ import os +import winreg # pytype: disable=import-error from typing import ( List, @@ -15,14 +16,6 @@ from . import ( 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'