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

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

Open
asharkinasuit opened this issue Mar 29, 2018 · 1 comment
Open

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

asharkinasuit opened this issue Mar 29, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request low priority

Comments

@asharkinasuit
Copy link

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.

@proycon
Copy link
Owner

proycon commented Mar 29, 2018

Right, good point!

@proycon proycon self-assigned this Mar 29, 2018
@proycon proycon transferred this issue from proycon/pynlpl Mar 14, 2019
@proycon proycon added enhancement New feature or request low priority labels Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants