File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def from_json(cls, data) -> Versions:
86
86
)
87
87
return cls (versions )
88
88
89
- def filter (self , branches : list [str ] = None ) -> Sequence [Version ]:
89
+ def filter (self , branches : Sequence [str ] = () ) -> Sequence [Version ]:
90
90
"""Filter the given versions.
91
91
92
92
If *branches* is given, only *versions* matching *branches* are returned.
@@ -95,8 +95,9 @@ def filter(self, branches: list[str] = None) -> Sequence[Version]:
95
95
security-fixes branches).
96
96
"""
97
97
if branches :
98
+ branches = frozenset (branches )
98
99
return [
99
- v for v in self if v .name in branches or v .branch_or_tag in branches
100
+ v for v in self if { v .name , v .branch_or_tag } & branches
100
101
]
101
102
return [v for v in self if v .status not in {"EOL" , "security-fixes" }]
102
103
@@ -996,9 +997,6 @@ def parse_args():
996
997
version_info ()
997
998
sys .exit (0 )
998
999
del args .version
999
- if args .branch and not args .branches :
1000
- args .branches = args .branch
1001
- del args .branch
1002
1000
if args .log_directory :
1003
1001
args .log_directory = args .log_directory .resolve ()
1004
1002
if args .build_root :
You can’t perform that action at this time.
0 commit comments