Mercurial > public > mercurial-scm > hg
comparison mercurial/httppeer.py @ 35197:bfd072c52e03
py3: use bytes in place of basestring
All strings in mercurial must be bytes so we can easily replace basestring with
bytes.
Differential Revision: https://phab.mercurial-scm.org/D1555
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 01 Dec 2017 16:53:55 +0530 |
parents | 67e9678efd98 |
children | 98bc4c43f570 |
comparison
equal
deleted
inserted
replaced
35196:5cc14407a739 | 35197:bfd072c52e03 |
---|---|
220 if postargsok and args: | 220 if postargsok and args: |
221 strargs = urlreq.urlencode(sorted(args.items())) | 221 strargs = urlreq.urlencode(sorted(args.items())) |
222 if not data: | 222 if not data: |
223 data = strargs | 223 data = strargs |
224 else: | 224 else: |
225 if isinstance(data, basestring): | 225 if isinstance(data, bytes): |
226 i = io.BytesIO(data) | 226 i = io.BytesIO(data) |
227 i.length = len(data) | 227 i.length = len(data) |
228 data = i | 228 data = i |
229 argsio = io.BytesIO(strargs) | 229 argsio = io.BytesIO(strargs) |
230 argsio.length = len(strargs) | 230 argsio.length = len(strargs) |