File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,7 @@ def __init__(
674674 if options .custom_typeshed_dir is not None :
675675 # Check if module lives under custom_typeshed_dir subtree
676676 custom_typeshed_dir = os .path .abspath (options .custom_typeshed_dir )
677+ path = os .path .abspath (path )
677678 if os .path .commonpath ((path , custom_typeshed_dir )) == custom_typeshed_dir :
678679 continue
679680
Original file line number Diff line number Diff line change @@ -1465,3 +1465,16 @@ sys.path = path
14651465mypy: "typing.py" shadows library module "typing"
14661466note: A user-defined top-level module with name "typing" is not supported
14671467== Return code: 2
1468+
1469+ [case testCustomTypeshedDirWithRelativePathDoesNotCrash]
1470+ # cmd: mypy --custom-typeshed-dir dir dir/typing.pyi
1471+ [file dir/stdlib/abc.pyi]
1472+ [file dir/stdlib/builtins.pyi]
1473+ [file dir/stdlib/sys.pyi]
1474+ [file dir/stdlib/types.pyi]
1475+ [file dir/stdlib/typing.pyi]
1476+ [file dir/stdlib/typing_extensions.pyi]
1477+ [file dir/stdlib/VERSIONS]
1478+ [out]
1479+ Failed to find builtin module mypy_extensions, perhaps typeshed is broken?
1480+ == Return code: 2
You can’t perform that action at this time.
0 commit comments