Skip to content

Commit

Permalink
Don't close the same fd twice
Browse files Browse the repository at this point in the history
  • Loading branch information
blorente committed Apr 25, 2019
1 parent 0819a54 commit b8d598d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/pants/java/nailgun_io.py
Expand Up @@ -83,7 +83,7 @@ def __init__(self, sock, write_handle):
@contextmanager
def open(cls, sock, isatty=False):
with _pipe(isatty) as (read_fd, write_fd):
reader = NailgunStreamStdinReader(sock, os.fdopen(write_fd, 'wb'))
reader = NailgunStreamStdinReader(sock, os.fdopen(os.dup(write_fd), 'wb'))
with reader.running():
# Instruct the thin client to begin reading and sending stdin.
NailgunProtocol.send_start_reading_input(sock)
Expand Down

0 comments on commit b8d598d

Please sign in to comment.