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'm currently using astpath to determine if we need a function's lone keyword to be optional, or if all of its callers pass it and therefore we can make it unconditionally required. I can get a list of callsites which use it:
$ astpath 'count(.//Call[func[Name[@id="report_diagnostic_event"]] and count(keywords) = 1])' -d cloudinit
Traceback (most recent call last):
File "/home/daniel/.virtualenvs/cloud-init/bin/astpath", line 8, in <module>
sys.exit(main())
File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/astpath/cli.py", line 37, in main
search(
File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/astpath/search.py", line 149, in search
file_matches = find_in_ast(
File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/astpath/search.py", line 42, in find_in_ast
for result in results:
TypeError: 'float' object is not iterable
I don't really know if I'm specifying valid XPath, but if this should work then I'd like it to (and if it shouldn't then perhaps a friendlier error message?).
The text was updated successfully, but these errors were encountered:
I'm currently using
astpath
to determine if we need a function's lone keyword to be optional, or if all of its callers pass it and therefore we can make it unconditionally required. I can get a list of callsites which use it:and then I thought I'd get clever:
I don't really know if I'm specifying valid XPath, but if this should work then I'd like it to (and if it shouldn't then perhaps a friendlier error message?).
The text was updated successfully, but these errors were encountered: