We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce406d9 commit 438a392Copy full SHA for 438a392
couchdb/view.py
@@ -24,13 +24,15 @@
24
log = logging.getLogger('couchdb.view')
25
26
27
-def run(input=sys.stdin, output=sys.stdout):
+def run(input=sys.stdin, output=None):
28
r"""CouchDB view function handler implementation for Python.
29
30
:param input: the readable file-like object to read input from
31
:param output: the writable file-like object to write output to
32
"""
33
functions = []
34
+ if output is None:
35
+ output = sys.stdout if sys.version_info[0] < 3 else sys.stdout.buffer
36
37
def _writejson(obj):
38
obj = json.encode(obj)
0 commit comments