Lines Matching refs: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
79 PREFIXES = [sys.prefix, sys.exec_prefix]
92 if sys.flags.verbose:
93 print(message, file=sys.stderr)
107 for m in set(sys.modules.values()):
129 """ Remove duplicate entries from sys.path along with making them
135 for dir in sys.path:
143 sys.path[:] = L
148 """Return a set containing all existing file system items from sys.path."""
150 for item in sys.path:
191 sys.path.append(dir)
195 file=sys.stderr)
197 for record in traceback.format_exception(*sys.exc_info()):
199 print(' '+line, file=sys.stderr)
200 print("\nRemainder of file ignored", file=sys.stderr)
208 """Add 'sitedir' argument to sys.path if missing and handle .pth files in
218 sys.path.append(sitedir) # Add path component
242 if sys.flags.no_user_site:
270 if sys.platform in {"emscripten", "vxworks", "wasi"}:
280 if sys.platform == "darwin" and sys._framework:
281 return joinuser("~", "Library", sys._framework,
282 "%d.%d" % sys.version_info[:2])
289 version = sys.version_info
292 ver_nodot = sys.winver.replace('.', '')
295 if sys.platform == 'darwin' and sys._framework:
332 """Add a per user site-package to sys.path
365 libdirs = [sys.platlibdir]
366 if sys.platlibdir != "lib":
371 "python%d.%d" % sys.version_info[:2],
380 """Add site-packages to sys.path"""
406 builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
407 if sys.platform[:4] == 'java':
418 here = getattr(sys, '_stdlib_dir', None)
435 registering a sys.__interactivehook__.
490 sys.__interactivehook__ = register_readline
496 if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
497 executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
499 executable = sys.executable
502 sys._home = None
526 sys._home = value
528 sys.prefix = sys.exec_prefix = site_prefix
531 addsitepackages(known_paths, [sys.prefix])
536 PREFIXES.insert(0, sys.prefix)
538 PREFIXES = [sys.prefix]
555 if sys.flags.verbose:
556 sys.excepthook(*sys.exc_info())
558 sys.stderr.write(
575 if sys.flags.verbose:
576 sys.excepthook(*sys.exc_info())
578 sys.stderr.write(
592 orig_path = sys.path[:]
594 if orig_path != sys.path:
595 # removeduppaths() might make sys.path absolute.
607 if not sys.flags.isolated:
613 # Prevent extending of sys.path when python was started with -S and
615 if not sys.flags.no_site:
633 args = sys.argv[1:]
637 print("sys.path = [")
638 for dir in sys.path:
649 sys.exit(0)
660 sys.exit(0)
662 sys.exit(1)
664 sys.exit(2)
666 sys.exit(3)
669 print(textwrap.dedent(help % (sys.argv[0], os.pathsep)))
670 sys.exit(10)