mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-65961: Stop setting __cached__ on modules
This commit is contained in:
parent
e32c975640
commit
28f1334f1a
32 changed files with 93 additions and 240 deletions
|
|
@ -57,7 +57,6 @@ def f():
|
|||
implicit_namespace = {
|
||||
"__name__": None,
|
||||
"__file__": None,
|
||||
"__cached__": None,
|
||||
"__package__": None,
|
||||
"__doc__": None,
|
||||
"__spec__": None
|
||||
|
|
@ -286,7 +285,6 @@ def _del_pkg(self, top):
|
|||
def _fix_ns_for_legacy_pyc(self, ns, alter_sys):
|
||||
char_to_add = "c"
|
||||
ns["__file__"] += char_to_add
|
||||
ns["__cached__"] = ns["__file__"]
|
||||
spec = ns["__spec__"]
|
||||
new_spec = importlib.util.spec_from_file_location(spec.name,
|
||||
ns["__file__"])
|
||||
|
|
@ -306,7 +304,6 @@ def _check_module(self, depth, alter_sys=False,
|
|||
expected_ns.update({
|
||||
"__name__": mod_name,
|
||||
"__file__": mod_fname,
|
||||
"__cached__": mod_spec.cached,
|
||||
"__package__": mod_name.rpartition(".")[0],
|
||||
"__spec__": mod_spec,
|
||||
})
|
||||
|
|
@ -347,7 +344,6 @@ def _check_package(self, depth, alter_sys=False,
|
|||
expected_ns.update({
|
||||
"__name__": mod_name,
|
||||
"__file__": mod_fname,
|
||||
"__cached__": importlib.util.cache_from_source(mod_fname),
|
||||
"__package__": pkg_name,
|
||||
"__spec__": mod_spec,
|
||||
})
|
||||
|
|
@ -552,7 +548,6 @@ def test_run_name(self):
|
|||
expected_ns.update({
|
||||
"__name__": run_name,
|
||||
"__file__": mod_fname,
|
||||
"__cached__": importlib.util.cache_from_source(mod_fname),
|
||||
"__package__": mod_name.rpartition(".")[0],
|
||||
"__spec__": mod_spec,
|
||||
})
|
||||
|
|
@ -632,7 +627,6 @@ def create_ns(init_globals):
|
|||
expected_ns.update({
|
||||
"__name__": expected_name,
|
||||
"__file__": expected_file,
|
||||
"__cached__": mod_cached,
|
||||
"__package__": "",
|
||||
"__spec__": mod_spec,
|
||||
"run_argv0": expected_argv0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue