MCPcopy Index your code
hub / github.com/RustPython/RustPython / resolve_frozen_alias

Function resolve_frozen_alias

crates/vm/src/vm/mod.rs:2266–2278  ·  view source on GitHub ↗

Resolve frozen module alias to its original name. Returns the original module name if an alias exists, otherwise returns the input name.

(name: &str)

Source from the content-addressed store, hash-verified

2264/// Resolve frozen module alias to its original name.
2265/// Returns the original module name if an alias exists, otherwise returns the input name.
2266pub fn resolve_frozen_alias(name: &str) -> &str {
2267 match name {
2268 "_frozen_importlib" => "importlib._bootstrap",
2269 "_frozen_importlib_external" => "importlib._bootstrap_external",
2270 "encodings_ascii" => "encodings.ascii",
2271 "encodings_utf_8" => "encodings.utf_8",
2272 "__hello_alias__" | "__phello_alias__" | "__phello_alias__.spam" => "__hello__",
2273 "__phello__.__init__" => "<__phello__",
2274 "__phello__.ham.__init__" => "<__phello__.ham",
2275 "__hello_only__" => "",
2276 _ => name,
2277 }
2278}
2279
2280#[test]
2281fn test_nested_frozen() {

Callers 2

import_frozenFunction · 0.85
find_frozenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected