comparison mercurial/scmwindows.py @ 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 9d3721552b6c
comparison
equal deleted inserted replaced
49808:7a4143428db7 49809:7a80a614c9e5
1 import os 1 import os
2 import winreg # pytype: disable=import-error
2 3
3 from typing import ( 4 from typing import (
4 List, 5 List,
5 Tuple, 6 Tuple,
6 ) 7 )
12 win32, 13 win32,
13 ) 14 )
14 15
15 if pycompat.TYPE_CHECKING: 16 if pycompat.TYPE_CHECKING:
16 from . import ui as uimod 17 from . import ui as uimod
17
18 try:
19 import _winreg as winreg # pytype: disable=import-error
20
21 winreg.CloseKey
22 except ImportError:
23 # py2 only
24 import winreg # pytype: disable=import-error
25 18
26 # MS-DOS 'more' is the only pager available by default on Windows. 19 # MS-DOS 'more' is the only pager available by default on Windows.
27 fallbackpager = b'more' 20 fallbackpager = b'more'
28 21
29 22