diff --git a/src/poetry/console/commands/self/self_command.py b/src/poetry/console/commands/self/self_command.py index 37738f44b1d..0c1a4ec3f79 100644 --- a/src/poetry/console/commands/self/self_command.py +++ b/src/poetry/console/commands/self/self_command.py @@ -75,7 +75,7 @@ def generate_system_pyproject(self) -> None: content = Factory.create_pyproject_from_package(package=package) for key in preserved: - content[key] = preserved[key] + content["tool"]["poetry"][key] = preserved[key] # type: ignore[index] self.system_pyproject.write_text(content.as_string(), encoding="utf-8")