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

Parsing error #10

Open
ArneBachmannDLR opened this issue Apr 18, 2023 · 3 comments
Open

Parsing error #10

ArneBachmannDLR opened this issue Apr 18, 2023 · 3 comments

Comments

@ArneBachmannDLR
Copy link

ArneBachmannDLR commented Apr 18, 2023

Getting this on Python 3.11:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bach_ar\.conda\envs\311\Scripts\cg.exe\__main__.py", line 7, in <module>
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\main.py", line 18, in cli
    main(args)
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\main.py", line 22, in main
    usage_graph = core.CodeGraph(args).usage_graph()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\core.py", line 75, in usage_graph
    entities_lines, imports, modules_names_map = get_imports_and_entities_lines(self.modules_data)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\core.py", line 126, in get_imports_and_entities_lines
    pathed_import, alias = pathed_import.split(' as ')
    ^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

Maybe the "import ... as ... " is not correctly supported?
The last file shown before the error was __main__.py which is always kind of special, the code in question might be this somewhat messed up line:
if '--imports' in sys.argv: from .progress import setup as import_logger; import_logger()

@xnuinside
Copy link
Owner

@ArneBachmannDLR, hello! Thanks for opening the issue, I will take a look on it later

@Kedarnath-Rothe
Copy link

Please assign to me

@xnuinside
Copy link
Owner

xnuinside commented Oct 9, 2023

@Kedarnath-Rothe I'm working on the new version - will release on this weekends, it will contain new visualisation & solve this issue also

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

3 participants