File tree Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Original file line number Diff line number Diff line change 1- # Test sys.std* objects.
1+ # Test sys.std*.buffer objects.
22
33import sys
44
55try :
6- sys .stdout
7- sys .stdin
8- sys .stderr
6+ sys .stdout . buffer
7+ sys .stdin . buffer
8+ sys .stderr . buffer
99except AttributeError :
1010 print ("SKIP" )
1111 raise SystemExit
1212
1313# CPython is more verbose; no need to match exactly
1414
15- print ('TextIOWrapper ' in str (sys .stdout ))
16- print ('TextIOWrapper ' in str (sys .stderr ))
17- print ('TextIOWrapper ' in str (sys .stdin ))
15+ print ('FileIO ' in str (sys .stdout . buffer ))
16+ print ('FileIO ' in str (sys .stderr . buffer ))
17+ print ('FileIO ' in str (sys .stdin . buffer ))
1818
19- print ('TextIOWrapper' in str (type (sys .stdout )))
20- print ('TextIOWrapper' in str (type (sys .stderr )))
21- print ('TextIOWrapper' in str (type (sys .stdin )))
22-
23- # # .buffer member is optional
24- # try:
25- # print('FileIO' in str(sys.stdout.buffer))
26- # print('FileIO' in str(sys.stderr.buffer))
27- # print('FileIO' in str(sys.stdin.buffer))
28- #
29- # print('FileIO' in str(type(sys.stdout.buffer)))
30- # print('FileIO' in str(type(sys.stderr.buffer)))
31- # print('FileIO' in str(type(sys.stdin.buffer)))
32- # except AttributeError:
33- # print("SKIP")
19+ print ('FileIO' in str (type (sys .stdout .buffer )))
20+ print ('FileIO' in str (type (sys .stderr .buffer )))
21+ print ('FileIO' in str (type (sys .stdin .buffer )))
You can’t perform that action at this time.
0 commit comments