Skip to content

Commit 4a29a11

Browse files
committed
Run autopep8 over tools folder
1 parent b51aceb commit 4a29a11

File tree

17 files changed

+65
-129
lines changed

17 files changed

+65
-129
lines changed

easybuild/tools/asyncprocess.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
:author: Jens Timmerman (Ghent University)
6666
"""
6767

68+
import fcntl # @UnresolvedImport
69+
import select # @UnresolvedImport
6870
import errno
6971
import os
7072
import subprocess
@@ -73,9 +75,6 @@
7375
PIPE = subprocess.PIPE
7476
STDOUT = subprocess.STDOUT
7577

76-
import select #@UnresolvedImport
77-
import fcntl #@UnresolvedImport
78-
7978

8079
class Popen(subprocess.Popen):
8180

@@ -117,7 +116,7 @@ def send(self, inp):
117116
try:
118117
written = os.write(self.stdin.fileno(), inp.encode())
119118
except OSError as why:
120-
if why[0] == errno.EPIPE: #broken pipe
119+
if why[0] == errno.EPIPE: # broken pipe
121120
return self._close('stdin')
122121
raise
123122

@@ -147,8 +146,10 @@ def _recv(self, which, maxsize):
147146
if not conn.closed:
148147
fcntl.fcntl(conn, fcntl.F_SETFL, flags)
149148

149+
150150
message = "Other end disconnected!"
151151

152+
152153
def recv_some(p, t=.2, e=1, tr=5, stderr=0):
153154
if tr < 1:
154155
tr = 1
@@ -171,6 +172,7 @@ def recv_some(p, t=.2, e=1, tr=5, stderr=0):
171172
time.sleep(max((x - time.time()) / tr, 0))
172173
return b''.join(y)
173174

175+
174176
def send_all(p, data):
175177
while len(data):
176178
sent = p.send(data)

0 commit comments

Comments
 (0)