mirror of
https://github.com/certbot/certbot.git
synced 2026-06-09 00:32:12 -04:00
Fix mypy
This commit is contained in:
parent
254e51925b
commit
3d19e6e7c9
1 changed files with 5 additions and 5 deletions
|
|
@ -277,23 +277,23 @@ class _DeprecationModule:
|
|||
Internal class delegating to a module, and displaying warnings when attributes
|
||||
related to deprecated attributes in the current module.
|
||||
"""
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: ModuleType):
|
||||
self.__dict__['_module'] = module
|
||||
|
||||
def __getattr__(self, attr):
|
||||
def __getattr__(self, attr: str) -> Any:
|
||||
if attr in ('LexiconClient', 'build_lexicon_config'):
|
||||
warnings.warn(f'{attr} attribute in {__name__} module is deprecated '
|
||||
'and will be removed soon.',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
return getattr(self._module, attr)
|
||||
|
||||
def __setattr__(self, attr, value): # pragma: no cover
|
||||
def __setattr__(self, attr: str, value: Any) -> None: # pragma: no cover
|
||||
setattr(self._module, attr, value)
|
||||
|
||||
def __delattr__(self, attr): # pragma: no cover
|
||||
def __delattr__(self, attr: str) -> Any: # pragma: no cover
|
||||
delattr(self._module, attr)
|
||||
|
||||
def __dir__(self): # pragma: no cover
|
||||
def __dir__(self) -> List[str]: # pragma: no cover
|
||||
return ['_module'] + dir(self._module)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue