diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-22 12:29:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-22 12:29:54 (GMT) |
commit | ad7b6c3720da0b12296a6fd69d882fc1bc296d99 (patch) | |
tree | 92cab13133644f45b43941928ed85bd3b7ecd876 | |
parent | ab983677470393c4b30f3b68985156f3e2b47a6f (diff) | |
download | cpython-ad7b6c3720da0b12296a6fd69d882fc1bc296d99.zip cpython-ad7b6c3720da0b12296a6fd69d882fc1bc296d99.tar.gz cpython-ad7b6c3720da0b12296a6fd69d882fc1bc296d99.tar.bz2 |
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.
-rw-r--r-- | Lib/test/libregrtest/save_env.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index 261c8f4..96ad3af 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -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 |