Kaydet (Commit) ad7b6c37 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #27829: libregrtest.save_env: flush stderr

Use flush=True to try to get a warning which is missing in buildbots.

Use also f-string to make the code shorter.
üst ab983677
...@@ -277,11 +277,9 @@ class saved_test_environment: ...@@ -277,11 +277,9 @@ class saved_test_environment:
self.changed = True self.changed = True
restore(original) restore(original)
if not self.quiet and not self.pgo: if not self.quiet and not self.pgo:
print("Warning -- {} was modified by {}".format( print(f"Warning -- {name} was modified by {self.testname}",
name, self.testname), file=sys.stderr, flush=True)
file=sys.stderr)
if self.verbose > 1: if self.verbose > 1:
print(" Before: {}\n After: {} ".format( print(f" Before: {original}\n After: {current} ",
original, current), file=sys.stderr, flush=True)
file=sys.stderr)
return False return False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment