Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pathutil.py @ 49979:15175774e1c5
typing: import unconditionally
This is needed if we're writing python3 signatures.
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Mon, 16 Jan 2023 12:10:20 +0000 |
parents | 5f664401dd03 |
children | 7623d79f872c |
comparison
equal
deleted
inserted
replaced
49978:cd125eef4388 | 49979:15175774e1c5 |
---|---|
1 import contextlib | 1 import contextlib |
2 import errno | 2 import errno |
3 import os | 3 import os |
4 import posixpath | 4 import posixpath |
5 import stat | 5 import stat |
6 | |
7 from typing import ( | |
8 Any, | |
9 Callable, | |
10 Iterator, | |
11 Optional, | |
12 ) | |
6 | 13 |
7 from .i18n import _ | 14 from .i18n import _ |
8 from . import ( | 15 from . import ( |
9 encoding, | 16 encoding, |
10 error, | 17 error, |
11 policy, | 18 policy, |
12 pycompat, | 19 pycompat, |
13 util, | 20 util, |
14 ) | 21 ) |
15 | |
16 if pycompat.TYPE_CHECKING: | |
17 from typing import ( | |
18 Any, | |
19 Callable, | |
20 Iterator, | |
21 Optional, | |
22 ) | |
23 | |
24 | 22 |
25 rustdirs = policy.importrust('dirstate', 'Dirs') | 23 rustdirs = policy.importrust('dirstate', 'Dirs') |
26 parsers = policy.importmod('parsers') | 24 parsers = policy.importmod('parsers') |
27 | 25 |
28 | 26 |