File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,11 @@ def load_config(filename: str) -> Dict:
9595
9696 root = black .find_project_root ((filename ,))
9797
98- pyproject_filename = root / "pyproject.toml"
98+ # Black 22.1.0+ returns a tuple
99+ if isinstance (root , tuple ):
100+ pyproject_filename = root [0 ] / "pyproject.toml"
101+ else :
102+ pyproject_filename = root / "pyproject.toml"
99103
100104 if not pyproject_filename .is_file ():
101105 if GLOBAL_CONFIG is not None and GLOBAL_CONFIG .exists ():
Original file line number Diff line number Diff line change 11[tool .black ]
2- target-version = [' py27 ' ]
2+ target-version = [' py39 ' ]
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def test_load_config():
190190def test_load_config_target_version ():
191191 config = load_config (str (fixtures_dir / "target_version" / "example.py" ))
192192
193- assert config ["target_version" ] == {black .TargetVersion .PY27 }
193+ assert config ["target_version" ] == {black .TargetVersion .PY39 }
194194
195195
196196def test_load_config_py36 ():
You can’t perform that action at this time.
0 commit comments