File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
"""Exceptions raised by the *babelizer*."""
2
2
3
+ from __future__ import annotations
4
+
3
5
4
6
class BabelizeError (Exception ):
5
7
"""An exception that the babelizer can handle and show to the user."""
6
8
7
- def __init__ (self , message ):
9
+ def __init__ (self , message : str ):
8
10
self ._message = message
9
11
10
- def __str__ (self ):
12
+ def __str__ (self ) -> str :
11
13
"""Render a user-readable error message."""
12
14
return self ._message
13
15
Original file line number Diff line number Diff line change 1
1
"""Utility functions used by the babelizer."""
2
2
3
+ from __future__ import annotations
4
+
3
5
import pathlib
4
6
import subprocess
5
7
import sys
8
+ from collections .abc import Iterator
6
9
from contextlib import contextmanager
7
10
from contextlib import suppress
8
11
@@ -36,7 +39,7 @@ def setup_py(*args):
36
39
return [sys .executable , "setup.py" ] + list (args )
37
40
38
41
39
- def get_setup_py_version ():
42
+ def get_setup_py_version () -> str | None :
40
43
"""Get babelized package version.
41
44
42
45
Returns
@@ -64,7 +67,7 @@ def get_setup_py_version():
64
67
65
68
66
69
@contextmanager
67
- def save_files (files ):
70
+ def save_files (files : Iterator [ str ] ):
68
71
"""Generate repository files through a context.
69
72
70
73
Parameters
You can’t perform that action at this time.
0 commit comments