summaryrefslogtreecommitdiff
path: root/bin/flat-odf-cleanup.py
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-02-16 17:29:05 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-02-16 20:33:15 +0100
commit93495c2a94ab5a827912d73d24736eb9c1cc46cd (patch)
tree1e01064d30ae557643af40a8b76238ca4a01dd95 /bin/flat-odf-cleanup.py
parent8f24e1a32f55ed179594c9fb50ca33a85608db7b (diff)
flat-odf-cleanup.py: fix FutureWarning
The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. Change-Id: Ic1aedaff3569b9b3063823c747c1d09623b2efad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130032 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'bin/flat-odf-cleanup.py')
-rw-r--r--bin/flat-odf-cleanup.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/flat-odf-cleanup.py b/bin/flat-odf-cleanup.py
index cbaf03c65e7b..8d4c176af89b 100644
--- a/bin/flat-odf-cleanup.py
+++ b/bin/flat-odf-cleanup.py
@@ -238,12 +238,12 @@ def remove_unused(root):
# remove office:settings
settings = root.find(".//{urn:oasis:names:tc:opendocument:xmlns:office:1.0}settings")
- if settings:
+ if settings is not None:
root.remove(settings)
# scripts are almost never needed
scripts = root.find(".//{urn:oasis:names:tc:opendocument:xmlns:office:1.0}scripts")
- if scripts:
+ if scripts is not None:
root.remove(scripts)
# TODO: replace embedded image with some tiny one