From 083cc8ae4e8abfaca529cf3ea49e17125903adfc Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Mon, 18 May 2020 15:24:25 -0300 Subject: [PATCH] Simplified csvfile.py super call __del__ call --- pylib/anki/importing/csvfile.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pylib/anki/importing/csvfile.py b/pylib/anki/importing/csvfile.py index 861651fdf..17b957bdd 100644 --- a/pylib/anki/importing/csvfile.py +++ b/pylib/anki/importing/csvfile.py @@ -141,12 +141,10 @@ class TextImporter(NoteImporter): def __del__(self): self.close() - try: - super().__del__ # type: ignore - except AttributeError: - pass - else: - super().__del__(self) # type: ignore + zuper = super() + if hasattr(zuper, "__del__"): + # pylint: disable=no-member + zuper.__del__(self) # type: ignore def noteFromFields(self, fields: List[str]) -> ForeignNote: note = ForeignNote()