Lines Matching defs:sys

69 import sys
83 """Convert sys.path into a list of absolute, existing, unique paths."""
86 for dir in sys.path:
95 cls = sys.modules.get(func.__module__)
383 del sys.modules['__temp__']
415 raise ErrorDuringImport(path, sys.exc_info())
430 if forceload and path in sys.modules:
431 if path not in sys.builtin_module_names:
432 # Remove the module from sys.modules and re-import to try
436 # in sys.modules.
437 subs = [m for m in sys.modules if m.startswith(path + '.')]
440 cache[key] = sys.modules[key]
441 del sys.modules[key]
445 (exc, value, tb) = info = sys.exc_info()
446 if path in sys.modules:
448 raise ErrorDuringImport(sys.modules[path].__file__, info)
457 raise ErrorDuringImport(path, sys.exc_info())
469 % sys.version_info[:2])
508 'marshal', 'posix', 'signal', 'sys',
650 name, module = object.__name__, sys.modules.get(object.__module__)
792 module = sys.modules.get(modname)
1560 if not hasattr(sys.stdin, "isatty"):
1562 if not hasattr(sys.stdout, "isatty"):
1564 if not sys.stdin.isatty() or not sys.stdout.isatty():
1566 if sys.platform == "emscripten":
1570 if sys.platform == 'win32': # pipes completely broken in Windows
1578 if sys.platform == 'win32':
1629 sys.platform == 'win32' else None
1636 encoding = getattr(sys.stdout, 'encoding', None) or 'utf-8'
1644 fd = sys.stdin.fileno()
1647 getchar = lambda: sys.stdin.read(1)
1650 getchar = lambda: sys.stdin.readline()[:-1][:1]
1660 sys.stdout.write('\n'.join(lines[:inc]) + '\n')
1662 sys.stdout.write('-- more --')
1663 sys.stdout.flush()
1667 sys.stdout.write('\r \r')
1670 sys.stdout.write('\r \r' + lines[r] + '\n')
1676 sys.stdout.write('\n' + '\n'.join(lines[r:r+inc]) + '\n')
1685 sys.stdout.write(plain(_escape_stdout(text)))
1690 if thing.__name__ in sys.builtin_module_names:
1985 return self._input or sys.stdin
1989 return self._output or sys.stdout
2038 if self.input is sys.stdin:
2081 '''.format('%d.%d' % sys.version_info[:2]))
2220 for modname in sys.builtin_module_names:
2504 names = [name for name in sys.builtin_module_names
2511 for dir in sys.path:
2744 """Ensures current directory is on sys.path, and __main__ directory is not.
2748 revised_path = _get_revised_path(sys.path, sys.argv[0])
2750 sys.path[:] = revised_path
2754 """Command-line interface (looks at sys.argv to decide what to do)."""
2761 opts, args = getopt.getopt(sys.argv[1:], 'bk:n:p:w')
2791 sys.exit(1)
2804 sys.exit(1)
2807 cmd = os.path.splitext(os.path.basename(sys.argv[0]))[0]