equal
deleted
inserted
replaced
958 if isinstance(hdr, bytes): |
958 if isinstance(hdr, bytes): |
959 del m[hdr] |
959 del m[hdr] |
960 hdr = pycompat.strurl(hdr) |
960 hdr = pycompat.strurl(hdr) |
961 change = True |
961 change = True |
962 if isinstance(val, bytes): |
962 if isinstance(val, bytes): |
963 val = pycompat.strurl(val) |
963 # header value should be ASCII since it's encoded by |
|
964 # mail.headencode(), but -n/--test disables it and raw |
|
965 # value of platform encoding is stored. |
|
966 val = encoding.strfromlocal(val) |
964 if not change: |
967 if not change: |
965 # prevent duplicate headers |
968 # prevent duplicate headers |
966 del m[hdr] |
969 del m[hdr] |
967 change = True |
970 change = True |
968 if change: |
971 if change: |