docs: Fix deprecation warnings in post-processor

Fixes #1502

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2019-02-13 15:08:56 +05:30 committed by Sunil Mohan Adapa
parent 7295a6d9cc
commit bc6ce14cdb
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -59,7 +59,7 @@ def subcommand_remove_footer(arguments):
# The footer will always be in the last <section>
def find_last_section(elem):
if elem.getchildren():
if len(elem):
last_element = elem[-1]
if last_element.tag == 'section':
return find_last_section(last_element)
@ -67,7 +67,7 @@ def subcommand_remove_footer(arguments):
last_section = find_last_section(root)
if last_section.getchildren():
if len(last_section):
# Remove all elements till <informaltable> is reached
while last_section[-1].tag != 'informaltable':
last_section.remove(last_section[-1])