Skip to content

Commit 474c7aa

Browse files
committed
Only set PYTHONDONTWRITEBYTECODE env variable for subprocess
Signed-off-by: Nico Burns <[email protected]>
1 parent f292b6e commit 474c7aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

style/build.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,17 @@ fn generate_properties(engine: &str) {
5353
}
5454
}
5555

56-
// `cargo publish` isn't happy with the `__pycache__` files that are created
57-
// when we run the property generator.
58-
//
59-
// TODO(mrobinson): Is this happening because of how we run this script? It
60-
// would be better to ensure are just placed in the output directory.
61-
env::set_var("PYTHONDONTWRITEBYTECODE", "1");
62-
6356
let script = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap())
6457
.join("properties")
6558
.join("build.py");
6659

6760
let status = Command::new(&*PYTHON)
61+
// `cargo publish` isn't happy with the `__pycache__` files that are created
62+
// when we run the property generator.
63+
//
64+
// TODO(mrobinson): Is this happening because of how we run this script? It
65+
// would be better to ensure are just placed in the output directory.
66+
.env("PYTHONDONTWRITEBYTECODE", "1")
6867
.arg(&script)
6968
.arg(engine)
7069
.arg("style-crate")

style/build_gecko.rs

+1
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ fn generate_atoms() {
369369
.join("regen_atoms.py");
370370
println!("cargo:rerun-if-changed={}", script.display());
371371
let status = Command::new(&*PYTHON)
372+
.env("PYTHONDONTWRITEBYTECODE", "1")
372373
.arg(&script)
373374
.arg(DISTDIR_PATH.as_os_str())
374375
.arg(OUTDIR_PATH.as_os_str())

0 commit comments

Comments
 (0)