diff --git a/fpdf/deprecation.py b/fpdf/deprecation.py index 8bf4dc8c6..dfbb0520c 100644 --- a/fpdf/deprecation.py +++ b/fpdf/deprecation.py @@ -14,7 +14,7 @@ def __getattr__(self, name): ) return None # pylint: disable=no-member - return super().__getattr__(self, name) + return super().__getattr__(name) def __setattr__(self, name, value): if name in ("FPDF_CACHE_DIR", "FPDF_CACHE_MODE"): @@ -26,4 +26,4 @@ def __setattr__(self, name, value): stacklevel=2, ) return - super().__setattr__(self, name, value) + super().__setattr__(name, value) diff --git a/test/fonts/test_add_font.py b/test/fonts/test_add_font.py index 0c4962392..e4c6022d5 100644 --- a/test/fonts/test_add_font.py +++ b/test/fonts/test_add_font.py @@ -39,6 +39,9 @@ def test_deprecation_warning_for_FPDF_CACHE_DIR(): with pytest.warns(DeprecationWarning): fpdf.FPDF_CACHE_MODE = 1 + fpdf.SOME = 1 + assert fpdf.SOME == 1 + import fpdf with pytest.warns(DeprecationWarning): @@ -50,6 +53,9 @@ def test_deprecation_warning_for_FPDF_CACHE_DIR(): with pytest.warns(DeprecationWarning): fpdf.FPDF_CACHE_MODE = 1 + fpdf.SOME = 1 + assert fpdf.SOME == 1 + def test_add_font_unicode_with_path_fname_ok(tmp_path): for font_cache_dir in (True, tmp_path):