comparison mercurial/windows.py @ 49318:6b39c7265935

windows: drop some py2 compatibility code The comment was wrong- the exception handler was the py3 case.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 13 Jun 2022 11:18:41 -0400
parents 709e5f7eec1f
children a75b530cfc29
comparison
equal deleted inserted replaced
49317:709e5f7eec1f 49318:6b39c7265935
12 import os 12 import os
13 import re 13 import re
14 import stat 14 import stat
15 import string 15 import string
16 import sys 16 import sys
17 import winreg # pytype: disable=import-error
17 18
18 from .i18n import _ 19 from .i18n import _
19 from .pycompat import getattr 20 from .pycompat import getattr
20 from . import ( 21 from . import (
21 encoding, 22 encoding,
23 policy, 24 policy,
24 pycompat, 25 pycompat,
25 win32, 26 win32,
26 ) 27 )
27 28
28 try:
29 import _winreg as winreg # pytype: disable=import-error
30
31 winreg.CloseKey
32 except ImportError:
33 # py2 only
34 import winreg # pytype: disable=import-error
35 29
36 osutil = policy.importmod('osutil') 30 osutil = policy.importmod('osutil')
37 31
38 getfsmountpoint = win32.getvolumename 32 getfsmountpoint = win32.getvolumename
39 getfstype = win32.getfstype 33 getfstype = win32.getfstype