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