Skip to content

mypy crashes in attempt to process relative import #5832

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

Closed
AndrewUshakov opened this issue Oct 24, 2018 · 1 comment
Closed

mypy crashes in attempt to process relative import #5832

AndrewUshakov opened this issue Oct 24, 2018 · 1 comment

Comments

@AndrewUshakov
Copy link

mypy (just cloned from github) crashed trying to parse line "from .a import *" from a file below.

# -*- coding: utf-8 -*-
from .a import *


def func_b(arg=DEFAULT):
    pass
    #print('ab.b.func_b():', arg)
    #func_a(1)

Stack trace is below:

`H:\My Documents\PyCharm\tst_mypy\ab>mypy b.py
Traceback (most recent call last):
  File "C:\Program Files\Python 3.7\Scripts\mypy-script.py", line 11, in <module>
    load_entry_point('mypy==0.650+dev.e09e72775bfeb622e67cab7d5eae0f12ef4adefa', 'console_scripts', 'mypy')()
  File "c:\program files\python 3.7\lib\site-packages\mypy\__main__.py", line 7, in console_entry
    main(None)
  File "c:\program files\python 3.7\lib\site-packages\mypy\main.py", line 92, in main
    res = build.build(sources, options, None, flush_errors, fscache)
  File "c:\program files\python 3.7\lib\site-packages\mypy\build.py", line 155, in build
    result = _build(sources, options, alt_lib_path, flush_errors, fscache)
  File "c:\program files\python 3.7\lib\site-packages\mypy\build.py", line 204, in _build
    graph = dispatch(sources, manager)
  File "c:\program files\python 3.7\lib\site-packages\mypy\build.py", line 2118, in dispatch
    graph = load_graph(sources, manager)
  File "c:\program files\python 3.7\lib\site-packages\mypy\build.py", line 2320, in load_graph
    ancestor_for=st)
  File "c:\program files\python 3.7\lib\site-packages\mypy\build.py", line 1382, in __init__
    assert id or path or source is not None, "Neither id, path nor source given"
AssertionError: Neither id, path nor source given
@ilevkivskyi
Copy link
Member

This is a duplicate of #2974

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

2 participants