Skip to content

Commit 8b1b77e

Browse files
milanprotimfel
authored andcommitted
Implemented gettimeout
1 parent f325275 commit 8b1b77e

File tree

1 file changed

+11
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/socket

1 file changed

+11
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/socket/SocketBuiltins.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ boolean get(PSocket socket) {
251251
abstract static class GetTimeoutNode extends PythonUnaryBuiltinNode {
252252
@Specialization
253253
Object get(PSocket socket) {
254+
try {
255+
if (socket.getSocket() != null) {
256+
socket.getSocket().socket().getSoTimeout();
257+
}
258+
259+
if (socket.getServerSocket() != null) {
260+
socket.getServerSocket().socket().getSoTimeout();
261+
}
262+
} catch (Exception e) {
263+
throw raise(PythonBuiltinClassType.OSError);
264+
}
254265
return PNone.NONE;
255266
}
256267
}

0 commit comments

Comments
 (0)