Преглед на файлове

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