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.
2
2
3
3
import sys
4
4
5
5
try :
6
- sys .stdout
7
- sys .stdin
8
- sys .stderr
6
+ sys .stdout . buffer
7
+ sys .stdin . buffer
8
+ sys .stderr . buffer
9
9
except AttributeError :
10
10
print ("SKIP" )
11
11
raise SystemExit
12
12
13
13
# CPython is more verbose; no need to match exactly
14
14
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 ))
18
18
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