equal
deleted
inserted
replaced
255 |
255 |
256 @encoding.strmethod |
256 @encoding.strmethod |
257 def __repr__(self): |
257 def __repr__(self): |
258 attrs = [] |
258 attrs = [] |
259 for a in ( |
259 for a in ( |
260 b'scheme', |
260 'scheme', |
261 b'user', |
261 'user', |
262 b'passwd', |
262 'passwd', |
263 b'host', |
263 'host', |
264 b'port', |
264 'port', |
265 b'path', |
265 'path', |
266 b'query', |
266 'query', |
267 b'fragment', |
267 'fragment', |
268 ): |
268 ): |
269 v = getattr(self, a) |
269 v = getattr(self, a) |
270 if v is not None: |
270 if v is not None: |
271 attrs.append(b'%s: %r' % (a, pycompat.bytestr(v))) |
271 line = b'%s: %r' |
|
272 line %= (pycompat.bytestr(a), pycompat.bytestr(v)) |
|
273 attrs.append(line) |
272 return b'<url %s>' % b', '.join(attrs) |
274 return b'<url %s>' % b', '.join(attrs) |
273 |
275 |
274 def __bytes__(self): |
276 def __bytes__(self): |
275 r"""Join the URL's components back into a URL string. |
277 r"""Join the URL's components back into a URL string. |
276 |
278 |