Skip to content

Commit 1b7c17d

Browse files
committed
automatic code fix
1 parent 9223e92 commit 1b7c17d

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

wolframclient/deserializers/wxf/wxfparser.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,29 @@
1414

1515
wxf_input_to_buffer = Dispatch()
1616

17+
1718
@wxf_input_to_buffer.dispatch((six.binary_type, six.buffer_types))
1819
def encode_buffer(wxf_input):
1920
return six.BytesIO(wxf_input)
2021

22+
2123
if six.PY2:
22-
@wxf_input_to_buffer.dispatch(memoryview, replace_existing = True)
24+
25+
@wxf_input_to_buffer.dispatch(memoryview, replace_existing=True)
2326
def encode_buffer(wxf_input):
24-
return six.BytesIO(wxf_input.tobytes())
27+
return six.BytesIO(wxf_input.tobytes())
28+
2529

2630
@wxf_input_to_buffer.dispatch(object)
2731
def encode_default(wxf_input):
28-
if hasattr(wxf_input, 'read'):
32+
if hasattr(wxf_input, "read"):
2933
return wxf_input
3034
raise TypeError(
3135
"Class %s neither implements a read method nor is a binary type."
3236
% wxf_input.__class__.__name__
3337
)
3438

3539

36-
3740
class WXFParser(object):
3841
"""Parse a WXF input.
3942
@@ -80,7 +83,7 @@ def __init__(self, wxf_input):
8083
"""WXF parser returning Python object from a WXF encoded byte sequence.
8184
"""
8285
self.context = SerializationContext()
83-
self.reader = wxf_input_to_buffer(wxf_input)
86+
self.reader = wxf_input_to_buffer(wxf_input)
8487

8588
version, compress = self.parse_header()
8689
if compress == True:

wolframclient/evaluation/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from wolframclient.evaluation.kernel.asyncsession import WolframLanguageAsyncSession
99
from wolframclient.exception import WolframKernelException
1010
from wolframclient.utils import six
11-
from wolframclient.utils.asyncio import run_in_loop
1211
from wolframclient.utils.api import asyncio
12+
from wolframclient.utils.asyncio import run_in_loop
1313
from wolframclient.utils.functional import is_iterable
1414

1515
logger = logging.getLogger(__name__)
@@ -295,4 +295,4 @@ async def parallel_evaluate(expressions, evaluator_spec=None, max_evaluators=4):
295295
given expressions evaluate on the same kernel.
296296
"""
297297
async with WolframEvaluatorPool(evaluator_spec, poolsize=max_evaluators) as pool:
298-
return await pool.evaluate_all(expressions)
298+
return await pool.evaluate_all(expressions)

wolframclient/utils/encoding.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
force_text = Dispatch()
88

9+
910
@force_text.dispatch(six.buffer_types)
1011
def encode(s, *args, **opts):
1112
return force_text(force_bytes(s, *args, **opts), *args, **opts)
1213

14+
1315
@force_text.dispatch(six.text_type)
1416
def encode(s, encoding="utf-8", errors="strict"):
1517
return s

0 commit comments

Comments
 (0)