Commits

Arnaud Grausem committed 75acb97

Argv parameter must be set to None to choose sys argv

  • Participants
  • Parent commits b8d26f2

Comments (0)

Files changed (1)

src/adama/__init__.py

     """Launches the right order or displaying the help for a command or an order
     directly from command line.
     """
-    argv = argv if argv else sys.argv[:]
+    argv = argv if argv is not None else sys.argv[:]
     command = os.path.basename(argv[0])
     module = module if module else command
     commander = Commander(module, doc=doc, command=command)
         order_name = argv[1] if not order_help else argv[2]
         try:
             order = commander[order_name]
-        except UnknownOrderError as e:
-            return e()
+        except UnknownOrderError as uoe:
+            return uoe()
         else:
             if order_help:
                 return order.explanations()
             else:
                 return order(argv[2:])
 
-
 def call_order(module_name, order_name, *args, **kwargs):
     """Calls an order from another python script directly
     """