File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,13 @@ def cname(self) -> str:
9292
9393 :return: (str) CName
9494 """
95-
95+ assert self . _flavor is not None , "CName flavor is not set!"
9696 cname = self ._flavor
9797
9898 if self ._arch is not None :
9999 cname += f"-{ self ._arch } "
100100
101- if self ._commit_id is not None :
101+ if self ._commit_id is not None and self . _version is not None :
102102 cname += f"-{ self .version_and_commit_id } "
103103
104104 return cname
@@ -114,7 +114,7 @@ def commit_id(self) -> Optional[str]:
114114 return self ._commit_id
115115
116116 @property
117- def flavor (self ) -> str :
117+ def flavor (self ) -> str | None :
118118 """
119119 Returns the flavor for the cname parsed.
120120
@@ -140,6 +140,7 @@ def platform(self) -> str:
140140
141141 :return: (str) Flavor
142142 """
143+ assert self ._flavor is not None , "Flavor not set!"
143144
144145 return re .split ("[_-]" , self ._flavor , maxsplit = 1 )[0 ]
145146
You can’t perform that action at this time.
0 commit comments