File: argparse-empty-array.patch

package info (click to toggle)
python-stestr 4.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 852 kB
  • sloc: python: 6,303; makefile: 32; sh: 12
file content (18 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: Deal with [] instead of 'None'
 argparse returns an empty array for any unknown arguments; detect
 this situation and default filters to None in this instance as
 already performed in the 'run' cli module.
Author: James Page <james.page@ubuntu.com>
Forwarded: https://github.com/mtreinish/stestr/pull/129

--- a/stestr/commands/list.py
+++ b/stestr/commands/list.py
@@ -48,7 +48,7 @@ def set_cli_opts(parser):
 
 def run(arguments):
     args = arguments[0]
-    filters = arguments[1]
+    filters = arguments[1] or None
     return list_command(config=args.config, repo_type=args.repo_type,
                         repo_url=args.repo_url, group_regex=args.group_regex,
                         test_path=args.test_path, top_dir=args.top_dir,