From ab93b9072ff2543ae09679c7b3f210a60cb11dcf Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 22 Aug 2003 21:31:17 +0000 Subject: [PATCH] Committing jemfinch's commaAndify fixes --- src/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/utils.py b/src/utils.py index 9e28502ce..4fd0dfde7 100755 --- a/src/utils.py +++ b/src/utils.py @@ -259,7 +259,8 @@ def findBinaryInPath(s): break return cmdLine -def commaAndify(L): +def commaAndify(seq): + L = list(seq) if len(L) == 0: return '' elif len(L) == 1: @@ -267,11 +268,7 @@ def commaAndify(L): elif len(L) == 2: return '%s and %s' % (L[0], L[1]) else: - # Not technically threadsafe. But we'll see if that matters. - originalLastElement = L[-1] L[-1] = 'and %s' % L[-1] - s = ', '.join(L) - L[-1] = originalLastElement - return s + return ', '.join(L) # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: