Skip to content

Commit

Permalink
fix python [object Object] moment when converting python version to…
Browse files Browse the repository at this point in the history
… string. bug from upstream
  • Loading branch information
DetachHead committed Aug 21, 2024
1 parent 01eea62 commit 7b1c88c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/analyzer/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4416,7 +4416,7 @@ export class Checker extends ParseTreeWalker {
this._evaluator.addDiagnostic(
DiagnosticRule.reportDeprecated,
LocMessage.deprecatedType().format({
version: deprecatedForm.version.toString(),
version: PythonVersion.toString(deprecatedForm.version),
replacement: deprecatedForm.replacementText,
}),
node
Expand Down
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/common/configOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ export class ConfigOptions {
const importFailureInfo: string[] = [];
this.defaultPythonVersion = host.getPythonVersion(this.pythonPath, importFailureInfo);
if (this.defaultPythonVersion !== undefined) {
console.info(`Assuming Python version ${this.defaultPythonVersion.toString()}`);
console.info(`Assuming Python version ${PythonVersion.toString(this.defaultPythonVersion)}`);
}

for (const log of importFailureInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export async function runPyrightServer(
testName: expect.getState().currentTestName ?? 'NoName',
code,
projectRoots: projectRootsArray.map((p) => (p.includes(':') ? UriEx.parse(p) : UriEx.file(p))),
pythonVersion: pythonVersion.toString(),
pythonVersion: PythonVersion.toString(pythonVersion),
backgroundAnalysis,
logFile: UriEx.file(path.join(__dirname, `log${process.pid}.txt`)),
pid: process.pid.toString(),
Expand Down

0 comments on commit 7b1c88c

Please sign in to comment.