Skip to content

[Bug] XML - testing an element's truth value will always return True in future versions #5756

@pesekon2

Description

@pesekon2

Describe the bug

Testing an XML element's truth value will always return True in future versions. This would cause issues once the new behaviour will be turned on. We should be prepared and avoid this unexpected behaviour in places where it is in use.

To reproduce

> g.extension i.modis op=remove -f
/home/ondrej/workspace/grass/dist.x86_64-pc-linux-gnu/scripts/g.extension:2149: DeprecationWarning: Testing an element's truth value will always return True in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if mnode:
/home/ondrej/workspace/grass/dist.x86_64-pc-linux-gnu/scripts/g.extension:2156: DeprecationWarning: Testing an element's truth value will always return True in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if bnode:

Expected behavior

Do not use deprecated operations.

System description

  • GRASS GIS version: 8.5dev

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions