Skip to contentSkip to conversation

Fix error message generation

PATCH New Karl Hasselström 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix error message generation

The right-hand-side operand of % is supposed to be a tuple with the same number of arguments as there are formatting codes in the left-hand-side operand, or just any value if there is just one formatting code; however, here it was a variable with a tuple value, which didn't work. So wrap it in a tuple of length one, and all is well again.

---

 stgit/run.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
stgit/run.py +1 -1
index 989bb27..83bf5f5 100644
@@ -40,7 +40,7 @@ class Run:
         self.__cmd = list(cmd)
         for c in cmd:
             if type(c) != str:
-                raise Exception, 'Bad command: %r' % cmd
+                raise Exception, 'Bad command: %r' % (cmd,)
         self.__good_retvals = [0]
         self.__env = None
         self.__indata = None