From 930d2d320a89684bf79a4de3bf0f6ab12300a415 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Oct 2025 19:36:57 +0300 Subject: [PATCH] depinst: change vprint to print to stderr; the messages are status, not program output --- depinst/depinst.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/depinst/depinst.py b/depinst/depinst.py index c27edee..1198c1d 100644 --- a/depinst/depinst.py +++ b/depinst/depinst.py @@ -21,7 +21,7 @@ verbose = 0 def vprint( level, *args ): if verbose >= level: - print( *args ) + print( *args, file=sys.stderr ) class CommandExecutionError(Exception): @@ -329,7 +329,5 @@ if( __name__ == "__main__" ): except Exception as e: - sys.stdout.flush() - - print( 'Error:', e, file=sys.stderr ) - sys.exit(1) + vprint( -1, 'Error:', e ) + sys.exit( 1 )