From e73c37d96e021f49d36d35a635747e19a0f2b42b Mon Sep 17 00:00:00 2001 From: "Manuel Amador (Rudd-O)" Date: Mon, 5 Sep 2016 03:06:19 +0000 Subject: [PATCH] Support older Python 3 versions that do not have os.setblocking --- bin/bombshell-client | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/bombshell-client b/bin/bombshell-client index 49c0634..9e6e2e9 100755 --- a/bin/bombshell-client +++ b/bin/bombshell-client @@ -172,7 +172,10 @@ class Signaler(MyThread): def unblock(fobj): - os.set_blocking(fobj.fileno(), False) + if hasattr(os, "set_blocking"): + return os.set_blocking(fobj.fileno(), False) + fl = fcntl.fcntl(fobj, fcntl.F_GETFL) + fcntl.fcntl(fobj, fcntl.F_SETFL, fl | os.O_NONBLOCK) def write(dst, buffer, l):