diff --git a/extra_tests/snippets/private_315_cache_contract.py b/extra_tests/snippets/private_315_cache_contract.py index 558fe124f..0f0bdfe88 100644 --- a/extra_tests/snippets/private_315_cache_contract.py +++ b/extra_tests/snippets/private_315_cache_contract.py @@ -18,7 +18,7 @@ if sys.implementation.name == "rustpython": with tempfile.TemporaryDirectory() as directory: root = Path(directory) source = root / "cache_subject.py" - source.write_text("value = 41\n", encoding="ascii") + source.write_text("value = 41\n", encoding="ascii", newline="\n") code = compile("value = 42\n", "byte_exact/cache_subject.py", "exec") stat = source.stat() headers = [ @@ -100,7 +100,7 @@ if sys.implementation.name == "rustpython": raise AssertionError("foreign ZIP cache accepted") # Explicit py_compile writes under -B; all writers must use the private token. - source.write_text("value = 41\n", encoding="ascii") + source.write_text("value = 41\n", encoding="ascii", newline="\n") explicit = root / "explicit.pyc" previous = sys.dont_write_bytecode sys.dont_write_bytecode = True