Skip to content

Commit a1f7c6d

Browse files
authored
backwards compatibility fix for pdm <2.26.2 (#32)
1 parent e420cae commit a1f7c6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pdm_build_locked/command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def handle(self, project: Project, options: argparse.Namespace) -> None:
4444
super().handle(project, options)
4545
return
4646

47-
# we need to let pdm known that we're intending to write this file
48-
project.pyproject.open_for_write()
47+
# we need to let pdm known that we're intending to write this file (only for pdm versions >=2.26.2)
48+
if hasattr(project.pyproject, "open_for_write"):
49+
project.pyproject.open_for_write()
4950

5051
# we are not interested in the pdm dev-dependencies group
5152
pdm_dev_dependencies = set()

0 commit comments

Comments
 (0)