Skip to content

Commit 0291093

Browse files
authored
Reword error message in wheel and wininst read (#601)
* Reword error message in wheel and wininst read * Updated invalid while error msg in wheel test
1 parent 2c01611 commit 0291093

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

tests/test_wheel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def test_read_invalid_wheel_extension():
7777

7878
file_name = os.path.join(os.path.dirname(__file__), "fixtures/twine-1.5.0.tar.gz")
7979
with pytest.raises(
80-
exceptions.InvalidDistribution, match=f"Not a known archive format: {file_name}"
80+
exceptions.InvalidDistribution,
81+
match=f"Not a known archive format for file: {file_name}",
8182
):
8283
wheel.Wheel(file_name)
8384

twine/wheel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def read_file(name):
6464
return archive.read(name)
6565

6666
else:
67-
raise exceptions.InvalidDistribution("Not a known archive format: %s" % fqn)
67+
raise exceptions.InvalidDistribution(
68+
"Not a known archive format for file: %s" % fqn
69+
)
6870

6971
try:
7072
for path in self.find_candidate_metadata_files(names):

twine/wininst.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def read_file(name):
3636
return archive.read(name)
3737

3838
else:
39-
raise exceptions.InvalidDistribution("Not a known archive format: %s" % fqn)
39+
raise exceptions.InvalidDistribution(
40+
"Not a known archive format for file: %s" % fqn
41+
)
4042

4143
try:
4244
tuples = [

0 commit comments

Comments
 (0)