Skip to content

Commit 0028a57

Browse files
authored
Remove some Any instances from the codebase (#3372)
1 parent 20bd845 commit 0028a57

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

archinstall/lib/general.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def clear_vt100_escape_codes_from_str(data: str) -> str:
4646
return re.sub(_VT100_ESCAPE_REGEX, '', data)
4747

4848

49-
def jsonify(obj: Any, safe: bool = True) -> Any:
49+
def jsonify(obj: object, safe: bool = True) -> object:
5050
"""
5151
Converts objects into json.dumps() compatible nested dictionaries.
5252
Setting safe to True skips dictionary keys starting with a bang (!)
@@ -85,7 +85,7 @@ class JSON(json.JSONEncoder, json.JSONDecoder):
8585
"""
8686

8787
@override
88-
def encode(self, o: Any) -> str:
88+
def encode(self, o: object) -> str:
8989
return super().encode(jsonify(o))
9090

9191

@@ -95,7 +95,7 @@ class UNSAFE_JSON(json.JSONEncoder, json.JSONDecoder):
9595
"""
9696

9797
@override
98-
def encode(self, o: Any) -> str:
98+
def encode(self, o: object) -> str:
9999
return super().encode(jsonify(o, safe=False))
100100

101101

archinstall/lib/models/locale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def preview(self) -> str:
3838
return output
3939

4040
@classmethod
41-
def _load_config(cls, config: 'LocaleConfiguration', args: dict[str, Any]) -> 'LocaleConfiguration':
41+
def _load_config(cls, config: 'LocaleConfiguration', args: dict[str, str]) -> 'LocaleConfiguration':
4242
if 'sys_lang' in args:
4343
config.sys_lang = args['sys_lang']
4444
if 'sys_enc' in args:

archinstall/lib/networking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import struct
88
import time
99
from types import FrameType, TracebackType
10-
from typing import Any, Self
10+
from typing import Self
1111
from urllib.error import URLError
1212
from urllib.parse import urlencode
1313
from urllib.request import urlopen
@@ -99,7 +99,7 @@ def update_keyring() -> bool:
9999
return False
100100

101101

102-
def enrich_iface_types(interfaces: dict[str, Any] | list[str]) -> dict[str, str]:
102+
def enrich_iface_types(interfaces: list[str]) -> dict[str, str]:
103103
result = {}
104104

105105
for iface in interfaces:

0 commit comments

Comments
 (0)