diff --git a/Cargo.toml b/Cargo.toml index 4a79aff38..cf617a1a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,8 @@ members = [ ] [features] -default = ["threading", "pylib", "stdlib", "zlib", "encodings"] +default = ["threading", "pylib", "stdlib", "zlib", "importlib", "encodings"] +importlib = ["rustpython-vm/importlib"] encodings = ["rustpython-vm/encodings"] stdlib = ["rustpython-stdlib"] flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"] diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 4a696f6ba..eba1c2462 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -10,7 +10,8 @@ include = ["src/**/*.rs", "Cargo.toml", "build.rs", "Lib/**/*.py"] [features] default = ["compile-parse", "pylib"] -encodings = [] +importlib = [] +encodings = ["importlib"] vm-tracing-logging = [] flame-it = ["flame", "flamer"] pylib = ["rustpython-pylib"] diff --git a/vm/src/vm/setting.rs b/vm/src/vm/setting.rs index 2ae33fc5a..dbb571455 100644 --- a/vm/src/vm/setting.rs +++ b/vm/src/vm/setting.rs @@ -93,7 +93,7 @@ impl Default for Settings { argv: vec![], hash_seed: None, stdio_unbuffered: false, - allow_external_library: true, + allow_external_library: cfg!(feature = "importlib"), } } }