diff --git a/mercurial/ui.py b/mercurial/ui.py
index 20ad936ac5d2a58877ad2ed8ca389b246f9b1802_bWVyY3VyaWFsL3VpLnB5..3ff4b07412ad709d57e304c139d05469fede8fce_bWVyY3VyaWFsL3VpLnB5 100644
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -867,6 +867,7 @@
                                ''.join(causetb),
                                ''.join(exconly))
             else:
+                self.flush()  # flush debug or status message
                 traceback.print_exception(exc[0], exc[1], exc[2],
                                           file=self.ferr)
         return self.tracebackflag or force