# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-06-19 15:12:14 # Node ID f46a333fefcac83d835a5a61cf164311495c9422 # Parent a54ee130210a678f5664122df01c6deb42a8ed82 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. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -204,6 +204,8 @@ def nouideprecwarn(msg, version, stackle 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 = {