If you look closely at the exception here, where None
comes from is underlined with a different underline from the attempt at subscription, which directly indicates which one failed.
While it may be possible to improve that message, just pointing that out for things you have to deal with now (and it should be faster to fix places you have to deal with this than wait for a new python version to do even more than this)
(And you should not rely on stability of exception messages, they aren’t guaranteed, so I hope you don’t mean to programmatically handle TypeError exceptions like this rather than split things and handle each possible error properly)