File tree 1 file changed +13
-14
lines changed
Filter options
1 file changed +13
-14
lines changed
Original file line number Diff line number Diff line change @@ -378,20 +378,19 @@ def _parse_and_extend_config_file(
378
378
379
379
extend = parser ["mypy" ].pop ("extend" , None )
380
380
if extend :
381
- cwd = os .getcwd ()
382
- try :
383
- # process extend relative to the directory where we found current config
384
- os .chdir (os .path .dirname (abs_file_read ))
385
- parse_ret = _parse_and_extend_config_file (
386
- options = options ,
387
- set_strict_flags = set_strict_flags ,
388
- filename = os .path .abspath (expand_path (extend )),
389
- stdout = stdout ,
390
- stderr = stderr ,
391
- visited = visited ,
392
- )
393
- finally :
394
- os .chdir (cwd )
381
+ parse_ret = _parse_and_extend_config_file (
382
+ options = options ,
383
+ set_strict_flags = set_strict_flags ,
384
+ # refer to extend relative to directory where we found current config
385
+ filename = os .path .relpath (
386
+ os .path .normpath (
387
+ os .path .join (os .path .dirname (abs_file_read ), expand_path (extend ))
388
+ )
389
+ ),
390
+ stdout = stdout ,
391
+ stderr = stderr ,
392
+ visited = visited ,
393
+ )
395
394
396
395
if parse_ret is None :
397
396
print (f"{ extend } is not a valid path to extend from { abs_file_read } " , file = stderr )
You can’t perform that action at this time.
0 commit comments