Skip to content

Commit

Permalink
byper
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Dec 4, 2024
1 parent 2ce00ec commit 3195dc1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/compilers/src/compilers/vyper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use foundry_compilers_core::error::{Result, SolcError};
use semver::Version;
use serde::{de::DeserializeOwned, Serialize};
use std::{
io::{self, Write},
path::{Path, PathBuf},
process::{Command, Stdio},
str::FromStr,
Expand Down Expand Up @@ -152,8 +153,11 @@ impl Vyper {
let mut child = cmd.spawn().map_err(self.map_io_err())?;
debug!("spawned");

let stdin = child.stdin.as_mut().unwrap();
serde_json::to_writer(stdin, input)?;
{
let mut stdin = io::BufWriter::new(child.stdin.take().unwrap());
serde_json::to_writer(&mut stdin, input)?;
stdin.flush().map_err(self.map_io_err())?;
}
debug!("wrote JSON input to stdin");

let output = child.wait_with_output().map_err(self.map_io_err())?;
Expand Down

0 comments on commit 3195dc1

Please sign in to comment.