Lines Matching full:sys
1 """Append module search paths for third-party packages to sys.path.
8 Unix (including Mac OSX), it starts with sys.prefix and
9 sys.exec_prefix (if different) and appends
13 resulting directories, if they exist, are appended to sys.path, and
16 If a file named "pyvenv.cfg" exists one directory above sys.executable,
17 sys.prefix and sys.exec_prefix are set to that directory and
18 it is also checked for site-packages (sys.base_prefix and
19 sys.base_exec_prefix will always be the "real" prefixes of the Python
26 appended to sys.path, and also inspected for path configuration
31 to be added to sys.path. Non-existing directories (or
32 non-directories) are never added to sys.path; no directory is added to
33 sys.path more than once. Blank lines and lines beginning with
36 For example, suppose sys.prefix and sys.exec_prefix are set to
52 Then the following directories are added to sys.path, in this order:
72 import sys
78 PREFIXES = [sys.prefix, sys.exec_prefix]
101 for m in set(sys.modules.values()):
116 """ Remove duplicate entries from sys.path along with making them
122 for dir in sys.path:
130 sys.path[:] = L
135 """Return a set containing all existing file system items from sys.path."""
137 for item in sys.path:
173 sys.path.append(dir)
177 file=sys.stderr)
179 for record in traceback.format_exception(*sys.exc_info()):
181 print(' '+line, file=sys.stderr)
182 print("\nRemainder of file ignored", file=sys.stderr)
190 """Add 'sitedir' argument to sys.path if missing and handle .pth files in
199 sys.path.append(sitedir) # Add path component
223 if sys.flags.no_user_site:
257 if sys.platform == "darwin" and sys._framework:
258 return joinuser("~", "Library", sys._framework,
259 "%d.%d" % sys.version_info[:2])
266 version = sys.version_info
271 if sys.platform == 'darwin' and sys._framework:
305 """Add a per user site-package to sys.path
338 "python%d.%d" % sys.version_info[:2],
346 """Add site-packages to sys.path"""
371 builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
372 if sys.platform[:4] == 'java':
398 registering a sys.__interactivehook__.
453 sys.__interactivehook__ = register_readline
459 if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
460 executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
461 elif sys.platform == 'win32' and '__PYVENV_LAUNCHER__' in env:
462 executable = sys.executable
464 sys._base_executable = _winapi.GetModuleFileName(0)
469 executable = sys.executable
472 sys._home = None
496 sys._home = value
498 sys.prefix = sys.exec_prefix = site_prefix
501 addsitepackages(known_paths, [sys.prefix])
506 PREFIXES.insert(0, sys.prefix)
508 PREFIXES = [sys.prefix]
525 if sys.flags.verbose:
526 sys.excepthook(*sys.exc_info())
528 sys.stderr.write(
545 if sys.flags.verbose:
546 sys.excepthook(*sys.exc_info())
548 sys.stderr.write(
562 orig_path = sys.path[:]
564 if orig_path != sys.path:
565 # removeduppaths() might make sys.path absolute.
577 if not sys.flags.isolated:
583 # Prevent extending of sys.path when python was started with -S and
585 if not sys.flags.no_site:
603 args = sys.argv[1:]
607 print("sys.path = [")
608 for dir in sys.path:
616 sys.exit(0)
627 sys.exit(0)
629 sys.exit(1)
631 sys.exit(2)
633 sys.exit(3)
636 print(textwrap.dedent(help % (sys.argv[0], os.pathsep)))
637 sys.exit(10)