HomePhabricator

typing: add type hints to mercurial/error.py

Authored by mharbison72.

Description

typing: add type hints to mercurial/error.py

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.

Differential Revision: https://phab.mercurial-scm.org/D10274

Details

Committed
mharbison72Mar 25 2021, 6:59 PM
Differential Revision
D10274: typing: add type hints to mercurial/error.py
Parents
rHGe1d75c514ced: tests: add a (very slow) test that executes pytype
Branches
Unknown
Tags
Unknown