You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to print an attribute, but I'm getting an error:
$ astpath '//Name/@id'Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/astpath/search.py", line 44, in find_in_ast linenos = query( File "/usr/local/lib/python3.9/site-packages/astpath/search.py", line 12, in lxml_query return element.xpath(expression)AttributeError: 'lxml.etree._ElementUnicodeResult' object has no attribute 'xpath'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/bin/astpath", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/astpath/cli.py", line 37, in main search( File "/usr/local/lib/python3.9/site-packages/astpath/search.py", line 149, in search file_matches = find_in_ast( File "/usr/local/lib/python3.9/site-packages/astpath/search.py", line 49, in find_in_ast raise AttributeError(AttributeError: Element has no ancestor with line number.
Maybe if it's an ElementUnicodeResult we should just return instead of recursing into element.expath(expression)? Thanks for your work on this project!
The text was updated successfully, but these errors were encountered:
I'd like to print an attribute, but I'm getting an error:
Maybe if it's an
ElementUnicodeResult
we should just return instead of recursing intoelement.expath(expression)
? Thanks for your work on this project!The text was updated successfully, but these errors were encountered: