Skip to content

Commit

Permalink
mirrors: use pydantic model_validate_json()
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Dec 20, 2024
1 parent 75459f4 commit 56a9593
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions archinstall/lib/models/mirrors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime
import http.client
import json
import time
import urllib.error
import urllib.parse
Expand Down Expand Up @@ -200,7 +199,7 @@ def get_status_by_region(self, region: str, speed_sort: bool) -> list[MirrorStat
return sorted(region_list, key=lambda mirror: (mirror.score, mirror.speed))

def _parse_remote_mirror_list(self, mirrorlist: str) -> dict[str, list[MirrorStatusEntryV3]] | None:
mirror_status = MirrorStatusListV3(**json.loads(mirrorlist))
mirror_status = MirrorStatusListV3.model_validate_json(mirrorlist)

sorting_placeholder: dict[str, list[MirrorStatusEntryV3]] = {}

Expand Down

0 comments on commit 56a9593

Please sign in to comment.