diff --git a/mypy/config_parser.py b/mypy/config_parser.py index 0ee274abd1bcc..9b35114f9ad7f 100644 --- a/mypy/config_parser.py +++ b/mypy/config_parser.py @@ -112,6 +112,10 @@ def parse_config_file(options: Options, set_strict_flags: Callable[[], None], if not os.path.exists(config_file): continue try: + if 'MYPY_CONFIG_FILE_DIR' not in os.environ: + os.environ['MYPY_CONFIG_FILE_DIR'] = os.path.dirname(config_file) + else: + os.environ['MYPY_CONFIG_FILE_DIR'] += os.pathsep + os.path.dirname(config_file) parser.read(config_file) except configparser.Error as err: print("%s: %s" % (config_file, err), file=stderr)