[PATCH] Introduce a 'die' function.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Fredrik Kuivinen
2005-09-12 23:30:47 +02:00
committed by Junio C Hamano
parent ace36858d3
commit 654291a2ac
2 changed files with 13 additions and 14 deletions

View File

@ -10,6 +10,10 @@ if sys.version_info[0] < 2 or \
import subprocess
def die(*args):
printList(args, sys.stderr)
sys.exit(2)
# Debugging machinery
# -------------------
@ -28,11 +32,11 @@ def debug(*args):
if funcName in functionsToDebug:
printList(args)
def printList(list):
def printList(list, file=sys.stdout):
for x in list:
sys.stdout.write(str(x))
sys.stdout.write(' ')
sys.stdout.write('\n')
file.write(str(x))
file.write(' ')
file.write('\n')
# Program execution
# -----------------