Home
last modified time | relevance | path

Searched refs:__spec__ (Results 1 – 25 of 43) sorted by relevance

12

/external/python/cpython3/Lib/importlib/
Dresources.py41 if package.__spec__.submodule_search_locations is None:
43 package.__spec__.name))
48 if module.__spec__.submodule_search_locations is None:
73 spec = package.__spec__
81 if package.__spec__.origin is None or not package.__spec__.has_location:
93 absolute_package_path = os.path.abspath(package.__spec__.origin)
102 loader = cast(ResourceLoader, package.__spec__.loader)
104 if hasattr(package.__spec__.loader, 'get_data'):
108 package_name = package.__spec__.name
127 absolute_package_path = os.path.abspath(package.__spec__.origin)
[all …]
Dutil.py64 spec = module.__spec__
109 spec = module.__spec__
231 original_name = self.__spec__.name
234 attrs_then = self.__spec__.loader_state['__dict__']
235 original_type = self.__spec__.loader_state['__class__']
245 self.__spec__.loader.exec_module(self)
290 module.__spec__.loader = self.loader
299 module.__spec__.loader_state = loader_state
D_bootstrap.py281 spec = module.__spec__
309 self._spec = module.__spec__
462 spec = module.__spec__
549 module.__spec__ = spec
658 module.__spec__ = spec
814 name = module.__spec__.name
912 __spec__ = module.__spec__
919 if __spec__ is None:
922 return __spec__
D__init__.py142 name = module.__spec__.name
166 spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, target)
/external/python/cpython3/Doc/library/
Drunpy.rst52 The special global variables ``__name__``, ``__spec__``, ``__file__``,
62 ``__spec__`` will be set appropriately for the *actually* imported
63 module (that is, ``__spec__.name`` will always be *mod_name* or
94 accessible as ``__spec__.name``.
121 The special global variables ``__name__``, ``__spec__``, ``__file__``,
132 supplied path, and ``__spec__``, ``__cached__``, ``__loader__`` and
136 ``__spec__`` will be set appropriately for the imported ``__main__``
137 module (that is, ``__spec__.name`` will always be ``__main__``).
/external/python/cpython3/Lib/test/test_importlib/
Dtest_resource.py91 module.__spec__.loader = module.__loader__
92 module.__spec__.origin = module.__file__
Dtest_util.py85 self.assertEqual(module.__spec__, spec)
414 module.__spec__ = spec
426 module.__spec__ = spec
435 module.__spec__ = None
445 module.__spec__ = spec
455 del module.__spec__
Dtest_spec.py319 self.assertIs(loaded.__spec__, self.spec)
373 del loaded.__spec__
379 self.assertIs(loaded.__spec__, self.spec)
434 self.module.__spec__ = self.spec
443 self.module.__spec__ = self.spec
451 self.module.__spec__ = self.spec
459 self.module.__spec__ = self.spec
Dtest_namespace_pkgs.py326 self.assertEqual(foo.__loader__, foo.__spec__.loader)
332 self.assertIsNone(foo.__spec__.origin)
Dtest_api.py372 self.assertIsNone(module.__spec__)
450 self.assertIsNot(module.__spec__, None)
452 self.assertIsNot(module.__spec__, None)
Dtest_abc.py454 self.assertEqual(loader, module.__spec__.loader)
456 self.assertEqual(name, module.__spec__.name)
459 module.__spec__.submodule_search_locations)
465 module.__spec__ = self.util.spec_from_loader(name, loader)
Dtest_lazy.py71 module.__spec__ = spec
Dutil.py288 self.module_code[module.__spec__.name]()
443 module.__spec__ = spec
/external/python/cpython3/Lib/test/test_importlib/source/
Dtest_source_encoding.py95 module.__spec__ = importlib.util.spec_from_loader(self.module_name, loader)
151 module.__spec__ = importlib.util.spec_from_loader(module_name, loader)
Dtest_file_loader.py215 module.__spec__ = self.util.spec_from_loader('_temp', loader)
233 module.__spec__ = self.machinery.ModuleSpec('bad name', loader)
255 mod.__spec__ = self.util.spec_from_loader('_temp', loader)
287 mod.__spec__ = self.util.spec_from_loader('_temp', loader)
311 mod.__spec__ = self.util.spec_from_loader('_temp', loader)
342 mod.__spec__ = self.util.spec_from_loader('_temp', loader)
512 module.__spec__ = self.util.spec_from_loader(module_name, loader)
/external/python/cpython3/Lib/multiprocessing/
Dspawn.py172 main_mod_name = getattr(main_module.__spec__, "name", None)
239 if getattr(current_main.__spec__, "name", None) == mod_name:
/external/python/cpython3/Lib/
Dimp.py175 module.__spec__.loader = module.__loader__
195 module.__spec__.loader = module.__loader__
Drunpy.py84 __spec__ = mod_spec)
/external/python/cpython3/Doc/reference/
Dimport.rst521 The module's spec is exposed as the ``__spec__`` attribute on a module object.
561 expected to have the same value as ``__spec__.parent``.
565 ``__spec__.parent``.
567 .. attribute:: __spec__
569 The ``__spec__`` attribute must be set to the module spec that was
570 used when importing the module. Setting ``__spec__``
573 where ``__spec__`` is :ref:`set to None in some cases <main_spec>`.
575 When ``__package__`` is not defined, ``__spec__.parent`` is used as
581 ``__spec__.parent`` is used as a fallback when ``__package__`` is
646 If the module has a spec (``__spec__``), the import machinery will try
[all …]
/external/python/cpython3/Lib/test/test_importlib/frozen/
Dtest_loader.py20 module.__spec__ = spec
25 self.assertEqual(module.__spec__.origin, 'frozen')
/external/python/cpython3/Lib/test/
Dtest_imp.py288 self.assertEqual(module.__spec__.name, name)
289 self.assertEqual(module.__spec__.origin, spec.origin)
Dtest_pkgutil.py441 del mod.__spec__
450 mod.__spec__ = None
Dtest_module.py56 self.assertIs(foo.__spec__, None)
Dtest_pydoc.py901 self.assertEqual(loaded_pydoc.__spec__, pydoc.__spec__)
/external/python/cpython3/Misc/NEWS.d/
D3.7.0b2.rst38 ``__spec__.origin`` are set to None.
47 Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.

12