# HG changeset patch # User Matt Harbison # Date 1655133521 14400 # Node ID 6b39c7265935c14a4c90e2f1a591625b5015c4da # Parent 709e5f7eec1fa81d9280b2ee68fec336284e25a9 windows: drop some py2 compatibility code The comment was wrong- the exception handler was the py3 case. diff -r 709e5f7eec1f -r 6b39c7265935 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')