File tree 2 files changed +14
-0
lines changed 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,7 @@ def __init__(
674
674
if options .custom_typeshed_dir is not None :
675
675
# Check if module lives under custom_typeshed_dir subtree
676
676
custom_typeshed_dir = os .path .abspath (options .custom_typeshed_dir )
677
+ path = os .path .abspath (path )
677
678
if os .path .commonpath ((path , custom_typeshed_dir )) == custom_typeshed_dir :
678
679
continue
679
680
Original file line number Diff line number Diff line change @@ -1465,3 +1465,16 @@ sys.path = path
1465
1465
mypy: "typing.py" shadows library module "typing"
1466
1466
note: A user-defined top-level module with name "typing" is not supported
1467
1467
== 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