Skip to content

Commit

Permalink
mypy: remove workaround for mypy bug
Browse files Browse the repository at this point in the history
The bug was fixed in mypy version 1.7
  • Loading branch information
orndorffgrant committed Nov 14, 2023
1 parent 17aa472 commit e2dd6f8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions uaclient/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@

event = event_logger.get_event_logger()

# needed for solving mypy errors dealing with _lru_cache_wrapper
# Found at https://github.com/python/mypy/issues/5858#issuecomment-454144705
S = TypeVar("S", bound=str)


def str_cache(func: Callable[..., S]) -> S:
return lru_cache()(func) # type: ignore


class UAConfig:
data_paths = {
Expand Down Expand Up @@ -201,7 +193,7 @@ def ua_apt_http_proxy(self, value: str):
state_files.user_config_file.write(self.user_config)

@property # type: ignore
@str_cache
@lru_cache(maxsize=None)
def global_apt_http_proxy(self) -> Optional[str]:
global_val = self.user_config.global_apt_http_proxy
if global_val:
Expand All @@ -225,7 +217,7 @@ def global_apt_http_proxy(self, value: str):
state_files.user_config_file.write(self.user_config)

@property # type: ignore
@str_cache
@lru_cache(maxsize=None)
def global_apt_https_proxy(self) -> Optional[str]:
global_val = self.user_config.global_apt_https_proxy
if global_val:
Expand Down

0 comments on commit e2dd6f8

Please sign in to comment.