From 104660f0e3468324791c2c70267377a0b82b95f3 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 28 Dec 2021 19:45:20 +0000 Subject: [PATCH] Use `@staticmethod` decorator while defining the method --- pywikibot/tools/djvu.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py index 3474f5f071..048a8a11de 100644 --- a/pywikibot/tools/djvu.py +++ b/pywikibot/tools/djvu.py @@ -87,6 +87,7 @@ def __str__(self) -> str: """Return a string representation.""" return str("{}('{}')").format(self.__class__.__name__, self._filename) + @staticmethod def check_cache(fn): """Decorator to check if cache shall be cleared.""" cache = ['_page_count', '_has_text', '_page_info'] @@ -100,6 +101,7 @@ def wrapper(obj, *args, **kwargs): return _res return wrapper + @staticmethod def check_page_number(fn): """Decorator to check if page number is valid. @@ -312,8 +314,3 @@ def delete_page(self, n): assert self.page_info(new_ref_page, force=True) == ('', (sz, dpi)) return True - - # This is to be used only if this class is subclassed and the decorators - # needs to be used by the child. - check_page_number = staticmethod(check_page_number) - check_cache = staticmethod(check_cache)