File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33
33
import static com .oracle .graal .python .runtime .exception .PythonErrorType .ValueError ;
34
34
35
35
import java .io .BufferedReader ;
36
+ import java .io .Console ;
36
37
import java .io .IOException ;
37
38
import java .io .InputStream ;
38
39
import java .io .InputStreamReader ;
@@ -854,15 +855,15 @@ protected boolean readOpaque(VirtualFrame frame) {
854
855
@ TypeSystemReference (PythonArithmeticTypes .class )
855
856
public abstract static class IsATTYNode extends PythonBuiltinNode {
856
857
@ Specialization
858
+ @ TruffleBoundary
857
859
boolean isATTY (int fd ) {
858
860
// TODO: XXX: actually check
861
+ Console console = System .console ();
859
862
switch (fd ) {
860
863
case 0 :
861
- return getContext ().getStandardIn () == System .in ;
862
864
case 1 :
863
- return getContext ().getStandardOut () == System .out ;
864
865
case 2 :
865
- return getContext (). getStandardErr () == System . err ;
866
+ return console != null ;
866
867
default :
867
868
return false ;
868
869
}
You can’t perform that action at this time.
0 commit comments