Skip to content

Commit 15475c7

Browse files
fix: explicitly provide hostname for socket
1 parent f193678 commit 15475c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/interpreters/python.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createConnection, Socket } from "net";
22
import { spawn, ChildProcess } from 'child_process';
33
import { InterpreterProvider, InterpreterResult } from './interpreters';
4+
import { hostname } from 'os';
45

56
/**
67
* The PythonInterpreterProvider establishes a connection to a remote Python 3
@@ -48,7 +49,7 @@ export class PythonInterpreterProvider implements InterpreterProvider {
4849
if (data.includes("Server listening on")) {
4950
setTimeout(() => {
5051
console.log('Python REPL is ready...');
51-
this.connection = createConnection({ port: this.port }, () => {
52+
this.connection = createConnection({ port: this.port, host: hostname()}, () => {
5253
resolve();
5354
});
5455

0 commit comments

Comments
 (0)