@@ -1672,13 +1672,24 @@ def getargv(self, name, default="", replace=True):
1672
1672
return self .getargvlist (name , default , replace = replace )[0 ]
1673
1673
1674
1674
def getargv_install_command (self , name , default = "" , replace = True ):
1675
+ def _unescape_install_command_args (s ):
1676
+ s = s .replace (r"\{packages\}" , "{packages}" )
1677
+ s = s .replace (r"\{opts\}" , "{opts}" )
1678
+ return s
1679
+
1675
1680
s = self .getstring (name , default , replace = False )
1676
1681
if "{packages}" in s :
1677
1682
s = s .replace ("{packages}" , r"\{packages\}" )
1678
1683
if "{opts}" in s :
1679
1684
s = s .replace ("{opts}" , r"\{opts\}" )
1680
1685
1681
- return _ArgvlistReader .getargvlist (self , s , replace = replace )[0 ]
1686
+ values = _ArgvlistReader .getargvlist (self , s , replace = replace )
1687
+ if not values :
1688
+ # This occurs when factors are used, and a testenv doesnt have
1689
+ # a factorised value for install_command, most commonly occurring
1690
+ # if setting platform is also used.
1691
+ return _unescape_install_command_args (default )
1692
+ return values [0 ]
1682
1693
1683
1694
def getstring (self , name , default = None , replace = True , crossonly = False , no_fallback = False ):
1684
1695
x = None
0 commit comments