~homeworkprod/byceps

7f53f8da79a41591498b73356770ff1cf417adf4 — Jochen Kupperschmidt a month ago 335b42b
Remove unnecessary codec reader, fixes type issue
1 files changed, 1 insertions(+), 4 deletions(-)

M byceps/services/country/service.py
M byceps/services/country/service.py => byceps/services/country/service.py +1 -4
@@ 7,7 7,6 @@ byceps.services.country.service
"""

from __future__ import annotations
import codecs
from dataclasses import dataclass
import json



@@ 23,11 22,9 @@ class Country:

def get_countries() -> list[Country]:
    """Load countries from JSON file."""
    reader = codecs.getreader('utf-8')

    path = 'services/country/resources/countries.json'
    with current_app.open_resource(path) as f:
        records = json.load(reader(f))
        records = json.load(f)

    return [Country(**record) for record in records]