Lines Matching defs:sys
28 import sys
33 _MS_WINDOWS = (sys.platform == 'win32')
61 if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
62 if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS_STR_KEY):
69 return not sys.flags.ignore_environment and key in _os.environ
452 If sys.implementation.cache_tag is None then NotImplementedError is raised.
465 tag = sys.implementation.cache_tag
467 raise NotImplementedError('sys.implementation.cache_tag is None')
470 if sys.flags.optimize == 0:
473 optimization = sys.flags.optimize
480 if sys.pycache_prefix is not None:
482 # collisions within sys.pycache_prefix, if someone has two different
484 # same sys.pycache_prefix. Let's say sys.pycache_prefix is
501 sys.pycache_prefix,
514 sys.implementation.cache_tag is None then NotImplementedError is raised.
517 if sys.implementation.cache_tag is None:
518 raise NotImplementedError('sys.implementation.cache_tag is None')
522 if sys.pycache_prefix is not None:
523 stripped_path = sys.pycache_prefix.rstrip(path_separators)
877 sys_version='%d.%d' % sys.version_info[:2])
1076 if (not sys.dont_write_bytecode and bytecode_path is not None and
1270 is sys.path."""
1287 # This is a top-level module. sys.path contains the parent path.
1288 return 'sys', 'path'
1295 return getattr(sys.modules[parent_module_name], path_attr_name)
1391 """Meta path finder for sys.path and package __path__ attributes."""
1396 stored in sys.path_importer_caches (where implemented)."""
1397 for name, finder in list(sys.path_importer_cache.items()):
1401 del sys.path_importer_cache[name]
1410 """Search sys.path_hooks for a finder for 'path'."""
1411 if sys.path_hooks is not None and not sys.path_hooks:
1412 _warnings.warn('sys.path_hooks is empty', ImportWarning)
1413 for hook in sys.path_hooks:
1423 """Get the finder for the path entry from sys.path_importer_cache.
1437 finder = sys.path_importer_cache[path]
1440 sys.path_importer_cache[path] = finder
1498 """Try to find a spec for 'fullname' on sys.path or 'path'.
1500 The search is based on sys.path_hooks and sys.path_importer_cache.
1503 path = sys.path
1522 """find the module on sys.path or 'path' based on sys.path_hooks and
1523 sys.path_importer_cache.
1666 if not sys.platform.startswith('win'):
1683 if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
1688 """A class method which returns a closure to use on sys.path_hook
1753 sys.path_hooks.extend([FileFinder.path_hook(*supported_loaders)])
1754 sys.meta_path.append(PathFinder)