Просмотр исходного кода

Make `get_cmd_params()` tollerate commands with no arguments

Michael Hanke 1 год назад
Родитель
Сommit
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