瀏覽代碼

Make `get_cmd_params()` tollerate commands with no arguments

Michael Hanke 1 年之前
父節點
當前提交
76347d109c
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      datalad_gooey/api_utils.py

+ 2 - 0
datalad_gooey/api_utils.py

@@ -28,6 +28,8 @@ def get_cmd_params(cmd: Callable) -> List:
     """
     # lifted from setup_parser_for_interface()
     args, varargs, varkw, defaults = getargspec(cmd, include_kwonlyargs=True)
+    if not args:
+        return []
     return list(
         zip_longest(
             # fuse parameters from the back, to match with their respective