( )⚙ D10274 typing: add type hints to mercurial/error.py

This is an archive of the discontinued Mercurial Phabricator instance.

typing: add type hints to mercurial/error.py
ClosedPublic

Authored by mharbison72 on Mar 25 2021, 8:10 PM.

Details

Summary

The only slightly unusual things here are that location is passed to
ParseError and both bytes and an int (so this accepts both), and the message
passed ProgrammingError is immediately converted to str. Therefore it is
typed as AnyStr, because there are a couple of instances that are already
passed as str.

There are a couple of places where bytes are being passed to builtin exceptions
that might need to be converted to str.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

mharbison72 created this revision.Mar 25 2021, 8:10 PM
pulkit accepted this revision.Apr 11 2021, 5:27 PM
This revision is now accepted and ready to land.Apr 11 2021, 5:27 PM
This revision was automatically updated to reflect the committed changes.