Updated for type hints

This commit is contained in:
Dimitris Zlatanidis 2023-04-27 22:54:22 +03:00
parent e5f549b900
commit e6ef721b13

View file

@ -8,7 +8,7 @@ import fnmatch
import logging
import subprocess
from pathlib import Path
from typing import Generator, Union
from typing import Generator
from slpkg.configs import Configs
from slpkg.blacklist import Blacklist
@ -127,7 +127,7 @@ class Utilities(Configs):
self.__class__.read_packages_from_file.__name__)
self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20)
def read_file(self, file: Union[str, Path]) -> list:
def read_file(self, file: Path) -> list:
""" Reads the text file. """
try:
with open(file, 'r', encoding='utf-8', errors='replace') as f: