Skip to content

Commit ef7da6a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fb121a0 commit ef7da6a

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

execnet/gateway.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class Gateway(gateway_base.BaseGateway):
21-
""" Gateway to a local or remote Python Intepreter. """
21+
"""Gateway to a local or remote Python Intepreter."""
2222

2323
def __init__(self, io, spec):
2424
super(Gateway, self).__init__(io=io, id=spec.id, _startcount=1)
@@ -30,7 +30,7 @@ def remoteaddress(self):
3030
return self._io.remoteaddress
3131

3232
def __repr__(self):
33-
""" return string representing gateway type and status. """
33+
"""return string representing gateway type and status."""
3434
try:
3535
r = self.hasreceiver() and "receive-live" or "not-receiving"
3636
i = len(self._channelfactory.channels())
@@ -72,7 +72,7 @@ def reconfigure(self, py2str_as_py3str=True, py3str_as_py2str=False):
7272
self._send(Message.RECONFIGURE, data=data)
7373

7474
def _rinfo(self, update=False):
75-
""" return some sys/env information from remote. """
75+
"""return some sys/env information from remote."""
7676
if update or not hasattr(self, "_cache_rinfo"):
7777
ch = self.remote_exec(rinfo_source)
7878
try:
@@ -82,11 +82,11 @@ def _rinfo(self, update=False):
8282
return self._cache_rinfo
8383

8484
def hasreceiver(self):
85-
""" return True if gateway is able to receive data. """
85+
"""return True if gateway is able to receive data."""
8686
return self._receivepool.active_count() > 0
8787

8888
def remote_status(self):
89-
""" return information object about remote execution status. """
89+
"""return information object about remote execution status."""
9090
channel = self.newchannel()
9191
self._send(Message.STATUS, channel.id)
9292
statusdict = channel.receive()
@@ -136,7 +136,7 @@ def remote_exec(self, source, **kwargs):
136136
return channel
137137

138138
def remote_init_threads(self, num=None):
139-
""" DEPRECATED. Is currently a NO-OPERATION already."""
139+
"""DEPRECATED. Is currently a NO-OPERATION already."""
140140
print("WARNING: remote_init_threads()" " is a no-operation in execnet-1.2")
141141

142142

execnet/gateway_base.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class WorkerPool(object):
239239
"""
240240

241241
def __init__(self, execmodel, hasprimary=False):
242-
""" by default allow unlimited number of spawns. """
242+
"""by default allow unlimited number of spawns."""
243243
self.execmodel = execmodel
244244
self._running_lock = self.execmodel.Lock()
245245
self._running = set()
@@ -316,12 +316,12 @@ def spawn(self, func, *args, **kwargs):
316316
return reply
317317

318318
def terminate(self, timeout=None):
319-
""" trigger shutdown and wait for completion of all executions. """
319+
"""trigger shutdown and wait for completion of all executions."""
320320
self.trigger_shutdown()
321321
return self.waitall(timeout=timeout)
322322

323323
def waitall(self, timeout=None):
324-
""" wait until all active spawns have finished executing. """
324+
"""wait until all active spawns have finished executing."""
325325
with self._running_lock:
326326
if not self._running:
327327
return True
@@ -393,7 +393,7 @@ def __init__(self, outfile, infile, execmodel):
393393
self.execmodel = execmodel
394394

395395
def read(self, numbytes):
396-
"""Read exactly 'numbytes' bytes from the pipe. """
396+
"""Read exactly 'numbytes' bytes from the pipe."""
397397
# a file in non-blocking mode may return less bytes, so we loop
398398
buf = bytes()
399399
while numbytes > len(buf):
@@ -404,7 +404,7 @@ def read(self, numbytes):
404404
return buf
405405

406406
def write(self, data):
407-
"""write out all data bytes. """
407+
"""write out all data bytes."""
408408
assert isinstance(data, bytes)
409409
self._write(data)
410410
self.outfile.flush()
@@ -417,7 +417,7 @@ def close_write(self):
417417

418418

419419
class Message:
420-
""" encapsulates Messages and their wire protocol. """
420+
"""encapsulates Messages and their wire protocol."""
421421

422422
_types = []
423423

@@ -453,7 +453,7 @@ def __repr__(self):
453453

454454

455455
class GatewayReceivedTerminate(Exception):
456-
""" Receiverthread got termination message. """
456+
"""Receiverthread got termination message."""
457457

458458

459459
def _setupmessages():
@@ -525,7 +525,7 @@ def geterrortext(excinfo, format_exception=traceback.format_exception, sysex=sys
525525

526526

527527
class RemoteError(Exception):
528-
""" Exception containing a stringified error from the other side. """
528+
"""Exception containing a stringified error from the other side."""
529529

530530
def __init__(self, formatted):
531531
self.formatted = formatted
@@ -544,7 +544,7 @@ def warn(self):
544544

545545

546546
class TimeoutError(IOError):
547-
""" Exception indicating that a timeout was reached. """
547+
"""Exception indicating that a timeout was reached."""
548548

549549

550550
NO_ENDMARKER_WANTED = object()
@@ -787,7 +787,7 @@ def __init__(self, gateway, startcount=1):
787787
self._list = list # needed during interp-shutdown
788788

789789
def new(self, id=None):
790-
""" create a new Channel with 'id' (or create new id if None). """
790+
"""create a new Channel with 'id' (or create new id if None)."""
791791
with self._writelock:
792792
if self.finished:
793793
raise IOError("connexion already closed: {}".format(self.gateway))
@@ -1011,11 +1011,11 @@ def _local_schedulexec(self, channel, sourcetask):
10111011
# _____________________________________________________________________
10121012
#
10131013
def newchannel(self):
1014-
""" return a new independent channel. """
1014+
"""return a new independent channel."""
10151015
return self._channelfactory.new()
10161016

10171017
def join(self, timeout=None):
1018-
""" Wait for receiverthread to terminate. """
1018+
"""Wait for receiverthread to terminate."""
10191019
self._trace("waiting for receiver thread to finish")
10201020
self._receivepool.waitall()
10211021

@@ -1296,7 +1296,7 @@ def load_channel(self):
12961296

12971297

12981298
class opcode:
1299-
""" container for name -> num mappings. """
1299+
"""container for name -> num mappings."""
13001300

13011301

13021302
def _buildopcodes():
@@ -1329,7 +1329,7 @@ def dumps(obj):
13291329

13301330

13311331
def dump(byteio, obj):
1332-
""" write a serialized bytestring of the given obj to the given stream. """
1332+
"""write a serialized bytestring of the given obj to the given stream."""
13331333
_Serializer(write=byteio.write).save(obj, versioned=True)
13341334

13351335

execnet/multi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
class Group(object):
23-
""" Gateway Groups. """
23+
"""Gateway Groups."""
2424

2525
defaultspec = "popen"
2626

@@ -163,7 +163,7 @@ def makegateway(self, spec=None):
163163
return gw
164164

165165
def allocate_id(self, spec):
166-
""" (re-entrant) allocate id for the given xspec object. """
166+
"""(re-entrant) allocate id for the given xspec object."""
167167
if spec.id is None:
168168
with self._autoidlock:
169169
id = "gw" + str(self._autoidcounter)

0 commit comments

Comments
 (0)