Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ README.html
htmlcov
.idea
.DS_Store
*.egg-info
11 changes: 3 additions & 8 deletions jsonrpcake/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,9 @@ class BinarySuppressedError(Exception):

def write(stream, outfile, flush):
"""Write the output stream."""
try:
# Writing bytes so we use the buffer interface (Python 3).
buf = outfile.buffer
except AttributeError:
buf = outfile

for chunk in stream:
buf.write(chunk)
outfile.write(chunk)
if flush:
outfile.flush()

Expand All @@ -78,7 +73,7 @@ def write_with_colors_win_py3(stream, outfile, flush):

def build_output_stream(args, env, request, response):
"""Build and return a chain of iterators over the `request`-`response`
exchange each of which yields `bytes` chunks.
exchange each of which yields chunks.

"""

Expand All @@ -101,7 +96,7 @@ def build_output_stream(args, env, request, response):
if env.stdout_isatty and resp:
# Ensure a blank line after the response body.
# For terminal output only.
output.append([b'\n\n'])
output.append(['\n\n'])

return chain(*output)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Pygments>=1.5
git+https://github.com/flowroute/jsonrpc-ns.git
jsonrpc-ns