mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Include _bootstrap.py as str
This commit is contained in:
1 parent
698044b128
commit
f1af6b1f40
3 files changed
+12
-4
No files matched your search
@@ -1,4 +1,3 @@
|
||||
pub const IMPORTLIB_BOOTSTRAP: &str = r#"
|
||||
"""Core implementation of import.
|
||||
|
||||
This module is NOT meant to be directly imported! It has been designed such
|
||||
@@ -1172,4 +1171,3 @@ def _install_external_importers():
|
||||
import _frozen_importlib_external
|
||||
_bootstrap_external = _frozen_importlib_external
|
||||
_frozen_importlib_external._install(sys.modules[__name__])
|
||||
"#;
|
||||
+12
-1
@@ -1,10 +1,21 @@
|
||||
use crate::importlib::IMPORTLIB_BOOTSTRAP;
|
||||
use std::collections::hash_map::HashMap;
|
||||
|
||||
const HELLO: &str = "initialized = True
|
||||
print(\"Hello world!\")
|
||||
";
|
||||
|
||||
const IMPORTLIB_BOOTSTRAP: &'static str = include_str!(concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/",
|
||||
"..",
|
||||
"/",
|
||||
"Lib",
|
||||
"/",
|
||||
"importlib",
|
||||
"/",
|
||||
"_bootstrap.py"
|
||||
));
|
||||
|
||||
pub fn get_module_inits() -> HashMap<String, &'static str> {
|
||||
let mut modules = HashMap::new();
|
||||
modules.insert("__hello__".to_string(), HELLO);
|
||||
|
||||
@@ -48,7 +48,6 @@ pub mod frame;
|
||||
mod frozen;
|
||||
pub mod function;
|
||||
pub mod import;
|
||||
mod importlib;
|
||||
pub mod obj;
|
||||
mod pyhash;
|
||||
pub mod pyobject;
|
||||
|
||||
Reference in new issue
Block a user