Skip to content

Commit a9cacc7

Browse files
authored
Merge pull request RustPython#4118 from youknowone/parser-error
panic when parser build failed
2 parents f1c7aeb + 54331fc commit a9cacc7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

parser/build.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ fn try_lalrpop(source: &str, target: &str) -> anyhow::Result<()> {
7171
}
7272

7373
#[cfg(feature = "lalrpop")]
74-
lalrpop::process_root().expect("running lalrpop failed");
74+
{
75+
lalrpop::process_root().expect("running lalrpop failed");
76+
Ok(())
77+
}
7578

7679
#[cfg(not(feature = "lalrpop"))]
77-
eprintln!("try: cargo build --manifest-path=parser/Cargo.toml --features=lalrpop");
78-
79-
Ok(())
80+
panic!("try: cargo build --manifest-path=parser/Cargo.toml --features=lalrpop");
8081
}
8182

8283
fn sha_equal(expected_sha3_str: &str, actual_sha3: &[u8; 32]) -> bool {

0 commit comments

Comments
 (0)