From 05a4485b020b9252f5ffc02d19c163705cbf26e2 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Wed, 2 Nov 2016 15:26:03 +0100 Subject: [PATCH] fix for futurewarning --- librarian/pyhtml.py | 2 +- librarian/pypdf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 = '' -- 2.20.1