@@ -128,20 +128,33 @@ async function resolvePriorityChainCore(
128128 ) ;
129129 }
130130 } else {
131- const resolved = await tryResolveInterpreterPath ( nativeFinder , api , expandedInterpreterPath , envManagers ) ;
132- if ( resolved ) {
133- traceVerbose ( `${ logPrefix } Priority 3: Using defaultInterpreterPath: ${ userInterpreterPath } ` ) ;
134- return { result : resolved , errors } ;
131+ const expandedInterpreterPath = resolveVariables ( userInterpreterPath , scope ) ;
132+ if ( expandedInterpreterPath . includes ( '${' ) ) {
133+ traceWarn (
134+ `${ logPrefix } defaultInterpreterPath '${ userInterpreterPath } ' contains unresolved variables, falling back to auto-discovery` ,
135+ ) ;
136+ const error : SettingResolutionError = {
137+ setting : 'defaultInterpreterPath' ,
138+ configuredValue : userInterpreterPath ,
139+ reason : l10n . t ( 'Path contains unresolved variables' ) ,
140+ } ;
141+ errors . push ( error ) ;
142+ } else {
143+ const resolved = await tryResolveInterpreterPath ( nativeFinder , api , expandedInterpreterPath , envManagers ) ;
144+ if ( resolved ) {
145+ traceVerbose ( `${ logPrefix } Priority 3: Using defaultInterpreterPath: ${ userInterpreterPath } ` ) ;
146+ return { result : resolved , errors } ;
147+ }
148+ const error : SettingResolutionError = {
149+ setting : 'defaultInterpreterPath' ,
150+ configuredValue : userInterpreterPath ,
151+ reason : `Could not resolve interpreter path '${ userInterpreterPath } '` ,
152+ } ;
153+ errors . push ( error ) ;
154+ traceWarn (
155+ `${ logPrefix } defaultInterpreterPath '${ userInterpreterPath } ' unresolvable, falling back to auto-discovery` ,
156+ ) ;
135157 }
136- const error : SettingResolutionError = {
137- setting : 'defaultInterpreterPath' ,
138- configuredValue : userInterpreterPath ,
139- reason : `Could not resolve interpreter path '${ userInterpreterPath } '` ,
140- } ;
141- errors . push ( error ) ;
142- traceWarn (
143- `${ logPrefix } defaultInterpreterPath '${ userInterpreterPath } ' unresolvable, falling back to auto-discovery` ,
144- ) ;
145158 }
146159 }
147160
0 commit comments