Skip to content

Commit

Permalink
pythongh-103088: Fix test_venv error message to avoid bytes/str warni…
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabolekar authored Apr 13, 2023
1 parent 70e0a28 commit 4307fea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,9 @@ def test_activate_shell_script_has_no_dos_newlines(self):
script_path = venv_dir / scripts_dir / "activate"
venv.create(venv_dir)
with open(script_path, 'rb') as script:
for line in script:
self.assertFalse(line.endswith(b'\r\n'), line)
for i, line in enumerate(script, 1):
error_message = f"CR LF found in line {i}"
self.assertFalse(line.endswith(b'\r\n'), error_message)

@requireVenvCreate
class EnsurePipTest(BaseTest):
Expand Down

0 comments on commit 4307fea

Please sign in to comment.