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.
This commit is contained in:
Victor Stinner 2016-08-22 14:29:54 +02:00
parent ab98367747
commit ad7b6c3720
1 changed files with 4 additions and 6 deletions

View File

@ -277,11 +277,9 @@ class saved_test_environment:
self.changed = True
restore(original)
if not self.quiet and not self.pgo:
print("Warning -- {} was modified by {}".format(
name, self.testname),
file=sys.stderr)
print(f"Warning -- {name} was modified by {self.testname}",
file=sys.stderr, flush=True)
if self.verbose > 1:
print(" Before: {}\n After: {} ".format(
original, current),
file=sys.stderr)
print(f" Before: {original}\n After: {current} ",
file=sys.stderr, flush=True)
return False