main: fix argv handling
closes
@@ -599,8 +599,11 @@ def main(argv=None):
:param argv: optional command line arguments, like sys.argv[1:]
:return: 0 on success, non-zero on failure
"""
- parser = make_parser(argv[1:] or sys.argv[1:])
- args = parser.parse_args(args=argv[1:])
+ if not argv:
+ argv = sys.argv[1:]
+
+ parser = make_parser(argv)
+ args = parser.parse_args(args=argv)
set_log_config(args)
