This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 4242
4343SIZE_1MB = 1024 * 1024
4444SYSTEM_ORG_NAME = 'system'
45+ ALPHA_API_SUBSTRING = "alpha"
4546
4647NSMAP = {
4748 'ns10' :
@@ -955,11 +956,17 @@ def get_supported_versions_list(self, include_alpha_versions: bool = False): #
955956 if not hasattr (version , 'deprecated' ) or \
956957 version .get ('deprecated' ).lower () == 'false' :
957958 active_versions .append (str (version .Version .text ))
958- if include_alpha_versions :
959+ if include_alpha_versions and hasattr ( versions , "AlphaVersion" ) :
959960 for version in versions .AlphaVersion :
960961 if not hasattr (version , 'deprecated' ) or \
961962 version .get ('deprecated' ) == 'false' :
962- active_versions .append (str (version .Version .text ))
963+ # alpha version may be of the form `3X.0.0-alpha-12345`
964+ # so we remove the portion after "alpha"
965+ alpha_version = str (version .Version .text )
966+ start_alpha_ind = alpha_version .find (ALPHA_API_SUBSTRING ) # noqa: E501
967+ if start_alpha_ind != - 1 :
968+ alpha_version = alpha_version [:start_alpha_ind + len (ALPHA_API_SUBSTRING )] # noqa: E501
969+ active_versions .append (alpha_version )
963970 active_versions .sort (key = VCDApiVersion )
964971 return active_versions
965972
You can’t perform that action at this time.
0 commit comments