Skip to content

[folia] Let xpath() fail more informatively #6

@asharkinasuit

Description

@asharkinasuit

Right now, the XML tree is discarded unless mode=XPATH was a keyword argument. If the xpath function is called on a document not in this mode, it fails with AttributeError: 'NoneType' object has no attribute 'xpath', which can be confusing. It's probably easy and good practice to check the mode in that method before trying to make the call that can lead to that error, and raise a more informative exception when appropriate.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions