Skip to content

Commit 7b7955a

Browse files
fix: Path.write_text does not have newline kwarg in 3.9
1 parent 0e085e0 commit 7b7955a

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "poetry-plugin-up"
3-
version = "0.9.0"
3+
version = "0.8.0"
44
description = "Poetry plugin that updates dependencies and bumps their versions in pyproject.toml file"
55
authors = ["Mousa Zeid Baker"]
66
packages = [

tests/conftest.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from pathlib import Path
23
from typing import List
34

@@ -48,7 +49,12 @@ def tmp_pyproject_path(
4849
tmp_pyproject_path = (
4950
tmp_path_factory.mktemp("simple_project") / "pyproject.toml"
5051
)
51-
tmp_pyproject_path.write_text(pyproject_content.as_string(), newline="\n")
52+
if sys.version_info >= (3, 10):
53+
tmp_pyproject_path.write_text(
54+
pyproject_content.as_string(), newline="\n"
55+
)
56+
else:
57+
tmp_pyproject_path.write_text(pyproject_content.as_string())
5258
return tmp_pyproject_path
5359

5460

@@ -78,9 +84,12 @@ def tmp_pyproject_path_v2(
7884
tmp_pyproject_path = (
7985
tmp_path_factory.mktemp("simple_project_poetry_v2") / "pyproject.toml"
8086
)
81-
tmp_pyproject_path.write_text(
82-
pyproject_content_v2.as_string(), newline="\n"
83-
)
87+
if sys.version_info >= (3, 10):
88+
tmp_pyproject_path.write_text(
89+
pyproject_content_v2.as_string(), newline="\n"
90+
)
91+
else:
92+
tmp_pyproject_path.write_text(pyproject_content_v2.as_string())
8493
return tmp_pyproject_path
8594

8695

0 commit comments

Comments
 (0)