From: Jan Szejko Date: Wed, 2 Nov 2016 14:26:03 +0000 (+0100) Subject: fix for futurewarning X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/05a4485b020b9252f5ffc02d19c163705cbf26e2?ds=inline fix for futurewarning --- diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 163d11c..38e0829 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -131,7 +131,7 @@ class EduModule(Xmill): counter = self.activity_counter - if element.getnext().tag == 'aktywnosc' or (self.activity_last and self.activity_last.getnext() == element): + if element.getnext().tag == 'aktywnosc' or (len(self.activity_last) and self.activity_last.getnext() == element): counter_html = """%(counter)d.""" % {'counter': counter} else: counter_html = '' diff --git a/librarian/pypdf.py b/librarian/pypdf.py index 9851cb1..408b18d 100644 --- a/librarian/pypdf.py +++ b/librarian/pypdf.py @@ -261,7 +261,7 @@ class EduModule(Xmill): counter = self.activity_counter - if element.getnext().tag == 'aktywnosc' or (self.activity_last and self.activity_last.getnext() == element): + if element.getnext().tag == 'aktywnosc' or (len(self.activity_last) and self.activity_last.getnext() == element): counter_tex = """%(counter)d.""" % locals() else: counter_tex = ''