equal
deleted
inserted
replaced
12 """ |
12 """ |
13 |
13 |
14 |
14 |
15 import difflib |
15 import difflib |
16 |
16 |
|
17 from typing import ( |
|
18 Any, |
|
19 AnyStr, |
|
20 Iterable, |
|
21 List, |
|
22 Optional, |
|
23 Sequence, |
|
24 Union, |
|
25 ) |
|
26 |
17 # Do not import anything but pycompat here, please |
27 # Do not import anything but pycompat here, please |
18 from . import pycompat |
28 from . import pycompat |
19 |
29 |
20 if pycompat.TYPE_CHECKING: |
30 |
21 from typing import ( |
31 # keeps pyflakes happy |
22 Any, |
32 assert [ |
23 AnyStr, |
33 Any, |
24 Iterable, |
34 AnyStr, |
25 List, |
35 Iterable, |
26 Optional, |
36 List, |
27 Sequence, |
37 Optional, |
28 Union, |
38 Sequence, |
29 ) |
39 Union, |
|
40 ] |
30 |
41 |
31 |
42 |
32 def _tobytes(exc): |
43 def _tobytes(exc): |
33 # type: (...) -> bytes |
44 # type: (...) -> bytes |
34 """Byte-stringify exception in the same way as BaseException_str()""" |
45 """Byte-stringify exception in the same way as BaseException_str()""" |