From: Guido van Rossum Date: Sat, 19 Dec 1998 23:53:33 +0000 (+0000) Subject: Use __stdin__ instead of stdin to derive FileType -- safer against X-Git-Tag: v1.5.2b1~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f05708f69bb90d2892b4e5c9521b19c1574c6b1;p=python Use __stdin__ instead of stdin to derive FileType -- safer against assignments. --- diff --git a/Lib/types.py b/Lib/types.py index c440a5cdf7..70e624a091 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -42,7 +42,7 @@ BuiltinMethodType = type([].append) # Same as BuiltinFunctionType ModuleType = type(sys) try: - FileType = type(sys.stdin) # XXX what if it was assigned to? + FileType = type(sys.__stdin__) except: pass XRangeType = type(xrange(0))