gh-103088: Fix test_venv error message to avoid bytes/str warning (GH-103500)

This commit is contained in:
Stanislav Syekirin 2023-04-13 15:17:14 +02:00 committed by GitHub
parent 70e0a28bed
commit 4307feaddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -623,8 +623,9 @@ class BasicTest(BaseTest):
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):