Mercurial > hg
changeset 44989:7af5c1f5b3a0
util: flush stderr explicitly after using warnings.warn()
Due to some unknown reasons, when using chg with python3, the warnings.warn()
output is not flushed.
Fixes test-devel-warnings.t on py3 with chg.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 19 Jun 2020 20:42:14 +0530 |
parents | fa151f7af275 |
children | 62bdb288c449 |
files | mercurial/util.py |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Thu Jun 18 22:23:22 2020 +0200 +++ b/mercurial/util.py Fri Jun 19 20:42:14 2020 +0530 @@ -204,6 +204,8 @@ b" update your code.)" ) % version warnings.warn(pycompat.sysstr(msg), DeprecationWarning, stacklevel + 1) + # on python 3 with chg, we will need to explicitly flush the output + sys.stderr.flush() DIGESTS = {