diff --git a/tests/test_wheel.py b/tests/test_wheel.py index e85fdb64..af24c73c 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -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) diff --git a/twine/wheel.py b/twine/wheel.py index acdbc6c2..a601caec 100644 --- a/twine/wheel.py +++ b/twine/wheel.py @@ -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): diff --git a/twine/wininst.py b/twine/wininst.py index 8b1fb666..b93cea1c 100644 --- a/twine/wininst.py +++ b/twine/wininst.py @@ -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 = [