# HG changeset patch # User Matt Harbison # Date 2022-06-13 15:18:41 # Node ID 6b39c7265935c14a4c90e2f1a591625b5015c4da # Parent 709e5f7eec1fa81d9280b2ee68fec336284e25a9 windows: drop some py2 compatibility code The comment was wrong- the exception handler was the py3 case. diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -14,6 +14,7 @@ import re import stat import string import sys +import winreg # pytype: disable=import-error from .i18n import _ from .pycompat import getattr @@ -25,13 +26,6 @@ from . import ( 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')