From e16c4c62a22a4d0344995a01927f22d70ab03d77 Mon Sep 17 00:00:00 2001 From: Hurrison Date: Wed, 17 Apr 2024 17:05:50 +0800 Subject: [PATCH] fix: variable head should not be set to empty after assignment --- dictutils.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dictutils.py b/dictutils.py index 20825db..49b0342 100644 --- a/dictutils.py +++ b/dictutils.py @@ -885,17 +885,14 @@ def get_memo (self, data): youci = youci[p1 + 5:] if youci: head = u'【优词】  ' - head = '' output.append(head + youci) xdf = detail.get('xdf') if xdf: head = u'【新东方】 ' - head = '' output.append(head + xdf) bzsd = detail.get('bzsd') if bzsd: head = u'【不择手段】 ' - head = '' output.append(head + self.text2html(bzsd)) if not output: return None @@ -909,12 +906,10 @@ def get_extra (self, data): resemble = detail.get('resemble') if resemble: head = u'【有道词语辨析】
\n' - head = '' output.append(head + resemble) syno = detail.get('syno') if syno: head = u'【有道近义词】
\n' - head = '' output.append(head + self.get_syno(data)) if not output: return None