Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/encoding.py @ 52664:9db77d46de79
py3: drop redundant `u''` prefixes on string literals
Strings are unicode on Python 3. These were rewritten by `pyupgrade`.
It's arguably better to fix the `contrib` stuff upstream and then re-vendor it,
but I don't feel like waiting for that, and then all of the regression testing
involved to get a minor improvement in the codebase. It was last vendored 5
years ago, and will likely be a large change anyway to drop py2 support. Also,
we've already made minor formatting changes to it locally.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 06 Jan 2025 14:15:40 -0500 |
parents | 54d9f496f07a |
children | 5cc8deb96b48 |
comparison
equal
deleted
inserted
replaced
52663:dc36535a5edc | 52664:9db77d46de79 |
---|---|
502 if width_so_far > width: | 502 if width_so_far > width: |
503 break | 503 break |
504 chars = chars[:i] | 504 chars = chars[:i] |
505 if leftside: | 505 if leftside: |
506 chars.reverse() | 506 chars.reverse() |
507 u = u''.join(chars).encode(_sysstr(encoding)) | 507 u = ''.join(chars).encode(_sysstr(encoding)) |
508 if leftside: | 508 if leftside: |
509 return ellipsis + u | 509 return ellipsis + u |
510 return u + ellipsis | 510 return u + ellipsis |
511 | 511 |
512 | 512 |