瀏覽代碼

Fixed wrong string formatting call

The number of arguments were missing last one. As discussed it's debugging error, so we actually want the arguments to be printed in the error. This commit fixes the formatting error, and adds the list of arguments to be printed together with the error.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Marcin Kuźmiński 10 年之前
父節點
當前提交
2114bdfa80
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      dulwich/hooks.py

+ 2 - 2
dulwich/hooks.py

@@ -76,8 +76,8 @@ class ShellHook(Hook):
 
 
         if len(args) != self.numparam:
         if len(args) != self.numparam:
             raise HookError("Hook %s executed with wrong number of args. \
             raise HookError("Hook %s executed with wrong number of args. \
-                            Expected %d. Saw %d. %s"
-                            % (self.name, self.numparam, len(args)))
+                            Expected %d. Saw %d. args: %s"
+                            % (self.name, self.numparam, len(args), args))
 
 
         if (self.pre_exec_callback is not None):
         if (self.pre_exec_callback is not None):
             args = self.pre_exec_callback(*args)
             args = self.pre_exec_callback(*args)