This is an archive of the discontinued Mercurial Phabricator instance.

branchmap: pytype is confused about bytestr

Authored by durin42 on Nov 6 2019, 5:59 PM.

Diff Detail

rHG Mercurial
Lint Skipped
Unit Tests Skipped

Event Timeline

durin42 created this revision.Nov 6 2019, 5:59 PM
indygreg accepted this revision.Nov 8 2019, 11:46 AM
indygreg added a subscriber: indygreg.

Could you please look into this in more detail? Presumably the type checker isn't seeing that pycompat.bytestr will accept anything that can be cast to str, which Exception can. So this feels like it is either a bug in pytype or a missing annotation somewhere. I'd like to know which.

But the comment draws attention to oddness. (I'm assuming we'll be able to disable most type annotator disables long term once more of the code base is properly type annotated.) So I'm fine landing this.

This revision is now accepted and ready to land.Nov 8 2019, 11:46 AM
This revision was automatically updated to reflect the committed changes.