Skip to content

Commit

Permalink
fix: explicitly provide hostname for socket
Browse files Browse the repository at this point in the history
  • Loading branch information
disposedtrolley committed Nov 3, 2020
1 parent f193678 commit 15475c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/interpreters/python.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createConnection, Socket } from "net";
import { spawn, ChildProcess } from 'child_process';
import { InterpreterProvider, InterpreterResult } from './interpreters';
import { hostname } from 'os';

/**
* The PythonInterpreterProvider establishes a connection to a remote Python 3
Expand Down Expand Up @@ -48,7 +49,7 @@ export class PythonInterpreterProvider implements InterpreterProvider {
if (data.includes("Server listening on")) {
setTimeout(() => {
console.log('Python REPL is ready...');
this.connection = createConnection({ port: this.port }, () => {
this.connection = createConnection({ port: this.port, host: hostname()}, () => {
resolve();
});

Expand Down

0 comments on commit 15475c7

Please sign in to comment.