comparison mercurial/mail.py @ 52653:b3e68fd7864b

pyupgrade: primitive types directly where possible This was rewritten by the `type_of_primitive` fixer in `pyupgrade`. Interesting that 9db77d46de79 missed a bunch of these `u''` prefixes.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 01:39:53 -0500
parents 9db77d46de79
children
comparison
equal deleted inserted replaced
52652:0e713555ecdc 52653:b3e68fd7864b
517 continue 517 continue
518 except (UnicodeDecodeError, LookupError): 518 except (UnicodeDecodeError, LookupError):
519 pass 519 pass
520 # On Python 3, decode_header() may return either bytes or unicode 520 # On Python 3, decode_header() may return either bytes or unicode
521 # depending on whether the header has =?<charset>? or not 521 # depending on whether the header has =?<charset>? or not
522 if isinstance(part, type(u'')): 522 if isinstance(part, str):
523 uparts.append(part) 523 uparts.append(part)
524 continue 524 continue
525 try: 525 try:
526 uparts.append(part.decode('UTF-8')) 526 uparts.append(part.decode('UTF-8'))
527 continue 527 continue