(x, conv)
| 2214 | # converters may use decode to workaround numpy's old behaviour, |
| 2215 | # so encode the string again before passing to the user converter |
| 2216 | def tobytes_first(x, conv): |
| 2217 | if type(x) is bytes: |
| 2218 | return conv(x) |
| 2219 | return conv(x.encode("latin1")) |
| 2220 | user_conv = functools.partial(tobytes_first, conv=conv) |
| 2221 | else: |
| 2222 | user_conv = conv |