Skip to content

Commit

Permalink
check: Use a new WarningStream for each render
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Aug 25, 2019
1 parent ea5145d commit 136de41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twine/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def check(dists, output_stream=sys.stdout):
output_stream.write("No files to check.\n")
return False

stream = _WarningStream()
failure = False

for filename in uploads:
output_stream.write("Checking distribution %s: " % filename)
warnings, is_ok = _check_file(filename, stream)
render_warning_stream = _WarningStream()
warnings, is_ok = _check_file(filename, render_warning_stream)

if not is_ok:
failure = True
Expand All @@ -122,7 +122,7 @@ def check(dists, output_stream=sys.stdout):
"The project's long_description has invalid markup which "
"will not be rendered on PyPI. The following syntax "
"errors were detected:\n"
"%s" % stream
"%s" % render_warning_stream
)
elif warnings:
output_stream.write("Passed, with warnings\n")
Expand Down

0 comments on commit 136de41

Please sign in to comment.