Skip to content

Commit 69df19d

Browse files
hauntsaninjaericmarkmartin
authored andcommitted
Fix regression for user config files (python#18656)
Fixes python#18650 Slightly annoying to add a test for since it would clutter up user home directory
1 parent 53d071c commit 69df19d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/defaults.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
CONFIG_NAMES: Final = ["mypy.ini", ".mypy.ini"]
1818
SHARED_CONFIG_NAMES: Final = ["pyproject.toml", "setup.cfg"]
1919

20-
USER_CONFIG_FILES: Final = ["~/.config/mypy/config", "~/.mypy.ini"]
20+
USER_CONFIG_FILES: list[str] = ["~/.config/mypy/config", "~/.mypy.ini"]
2121
if os.environ.get("XDG_CONFIG_HOME"):
2222
USER_CONFIG_FILES.insert(0, os.path.join(os.environ["XDG_CONFIG_HOME"], "mypy/config"))
23+
USER_CONFIG_FILES = [os.path.expanduser(f) for f in USER_CONFIG_FILES]
2324

2425
# This must include all reporters defined in mypy.report. This is defined here
2526
# to make reporter names available without importing mypy.report -- this speeds

0 commit comments

Comments
 (0)