Skip to content

Commit

Permalink
Reword error message in wheel and wininst read (#601)
Browse files Browse the repository at this point in the history
* Reword error message in wheel and wininst read

* Updated invalid while error msg in wheel test
  • Loading branch information
deveshks committed Apr 22, 2020
1 parent 2c01611 commit 0291093
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/test_wheel.py
Expand Up @@ -77,7 +77,8 @@ def test_read_invalid_wheel_extension():

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

Expand Down
4 changes: 3 additions & 1 deletion twine/wheel.py
Expand Up @@ -64,7 +64,9 @@ def read_file(name):
return archive.read(name)

else:
raise exceptions.InvalidDistribution("Not a known archive format: %s" % fqn)
raise exceptions.InvalidDistribution(
"Not a known archive format for file: %s" % fqn
)

try:
for path in self.find_candidate_metadata_files(names):
Expand Down
4 changes: 3 additions & 1 deletion twine/wininst.py
Expand Up @@ -36,7 +36,9 @@ def read_file(name):
return archive.read(name)

else:
raise exceptions.InvalidDistribution("Not a known archive format: %s" % fqn)
raise exceptions.InvalidDistribution(
"Not a known archive format for file: %s" % fqn
)

try:
tuples = [
Expand Down

0 comments on commit 0291093

Please sign in to comment.