Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FutureWarnings for testing lxml elements #979

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

geographika
Copy link
Contributor

Fixes the following FutureWarnings displayed when running the test suite:

  /home/runner/work/OWSLib/OWSLib/owslib/feature/wfs110.py:445: FutureWarning: Truth-testing of elements was a source of confusion and will always return True in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
    mdelem = doc.find(

Element objects are considered a False value if they have no children, so using or could skip the first result.

See https://github.com/lxml/lxml/blob/0eb4f0029497957e58a9f15280b3529bdb18d117/src/lxml/etree.pyx#L1313

@geographika geographika merged commit e69da97 into geopython:master Mar 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant