Commit bf29fe2
py/objstr: Use better msg in bad implicit str/bytes conversion exception
Instead of always reporting some object cannot be implicitly be converted
to a 'str', even when it is a 'bytes' object, adjust the logic so that
when trying to convert str to bytes it is shown like that.
This will still report bad implicit conversion from e.g. 'int to bytes'
as 'int to str' but it will not result in the confusing
'can't convert 'str' object to str implicitly' anymore for calls like
b'somestring'.count('a').1 parent 9b80a1e commit bf29fe2
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2065 | 2065 | | |
2066 | 2066 | | |
2067 | 2067 | | |
| 2068 | + | |
2068 | 2069 | | |
2069 | | - | |
2070 | | - | |
| 2070 | + | |
| 2071 | + | |
2071 | 2072 | | |
2072 | 2073 | | |
2073 | 2074 | | |
| |||
0 commit comments