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

AttributeError in ctest-to: ‘dict’ object has no attribute ‘parse_db’ #344

Open
hanexthink opened this issue May 17, 2024 · 0 comments

Comments

@hanexthink
Copy link

I encountered an AttributeError while running the ctest-to command. The error message indicates that a dictionary object is being accessed for an attribute parse_db, which does not exist. Below are the details of the traceback:

Traceback (most recent call last): File "/Users/hossein.afshari/.pyenv/versions/vdsql/bin/ctest-to", line 8, in <module> sys.exit(main()) ^^^^^^ File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/ctest_to.py", line 253, in main ctx.start(args.directory) File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/ctest_to.py", line 216, in start self.parse_file(os.path.join(self.cwd, "CTestTestfile.cmake")) File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/ctest_to.py", line 206, in parse_file _ = parse.parse(tokens, self.get_db()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/parse/__init__.py", line 68, in parse return BodyNode.consume(ctx, tokens) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/parse/body_nodes.py", line 67, in consume subtree = StatementNode.consume(ctx, tokens) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/hossein.afshari/.pyenv/versions/vdsql/lib/python3.11/site-packages/cmakelang/parse/statement_node.py", line 80, in consume parse_fun = ctx.parse_db.get(fnname, None) ^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'parse_db'

Steps to Reproduce

1.	Run the ctest-to command in the specified environment.

Environment

•	OS: macOS
•	Python Version: 3.11
•	cmakelang Version: cmakelang==0.6.13

Expected Behavior

The ctest-to command should parse the CTestTestfile.cmake file without raising an AttributeError.

Actual Behavior

The command raises an AttributeError indicating that a dict object is being accessed with an attribute parse_db, which does not exist.

Additional Information

It appears that there is an issue with the context or the way the parsing database is being accessed. This might be related to a recent change or an incompatibility with the specific Python version.

Request

Please investigate this issue and provide a fix or a workaround. Let me know if you need any further information or additional logs. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant