Skip to content

Commit 934851b

Browse files
committed
closes #18
1 parent 75e6875 commit 934851b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pylsp_mypy/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import collections
2323
import warnings
2424
import shutil
25+
import ast
2526

2627
line_pattern: str = r"((?:^[a-z]:)?[^:]+):(?:(\d+):)?(?:(\d+):)? (\w+): (.*)"
2728

@@ -307,7 +308,7 @@ def init(workspace: str) -> Dict[str, str]:
307308
path = findConfigFile(workspace, ["pylsp-mypy.cfg", "mypy-ls.cfg", "mypy_ls.cfg"])
308309
if path:
309310
with open(path) as file:
310-
configuration = eval(file.read())
311+
configuration = ast.literal_eval(file.read())
311312

312313
mypyConfigFile = findConfigFile(workspace, ["mypy.ini", ".mypy.ini"])
313314
mypyConfigFileMap[workspace] = mypyConfigFile

0 commit comments

Comments
 (0)