Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/protocol.py @ 34510:c23fa3103925
hgweb: in protocol adapter, look for bytes instances, not str
Differential Revision: https://phab.mercurial-scm.org/D963
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 05 Oct 2017 14:13:20 -0400 |
parents | e21f274cccea |
children | b2601c5977a4 |
comparison
equal
deleted
inserted
replaced
34509:e21f274cccea | 34510:c23fa3103925 |
---|---|
162 else: | 162 else: |
163 for chunk in gen: | 163 for chunk in gen: |
164 yield chunk | 164 yield chunk |
165 | 165 |
166 rsp = wireproto.dispatch(repo, p, cmd) | 166 rsp = wireproto.dispatch(repo, p, cmd) |
167 if isinstance(rsp, str): | 167 if isinstance(rsp, bytes): |
168 req.respond(HTTP_OK, HGTYPE, body=rsp) | 168 req.respond(HTTP_OK, HGTYPE, body=rsp) |
169 return [] | 169 return [] |
170 elif isinstance(rsp, wireproto.streamres): | 170 elif isinstance(rsp, wireproto.streamres): |
171 if rsp.reader: | 171 if rsp.reader: |
172 gen = iter(lambda: rsp.reader.read(32768), '') | 172 gen = iter(lambda: rsp.reader.read(32768), '') |