diff --git a/Lib/_sitebuiltins.py b/Lib/_sitebuiltins.py index c29cf4bf8..f6a0e1c2e 100644 --- a/Lib/_sitebuiltins.py +++ b/Lib/_sitebuiltins.py @@ -10,6 +10,11 @@ The objects used by the site module to add custom builtins. import sys +sys.stdin = getattr(sys, 'stdin', False) or open('/dev/stdin') +sys.stdout = getattr(sys, 'stdout', False) or open('/dev/stdout', 'w') +sys.stderr = getattr(sys, 'stderr', False) or open('/dev/stderr', 'w') + + class Quitter(object): def __init__(self, name, eof): self.name = name