Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the latest mypy (0.942), importlib.metadata.metadata now returns a Protocol named PackageMetadata that doesn't implement the get method. The actual object remains a Message class, however, so the get method works correctly. Only mypy checking fails. Pending python/typeshed#7767, which may reveal that it is intentional that get not be supported, cast the return value to Message so that the existing functions work. This seems better than adding try/catch blocks for every piece of metadata of interest given that the omission of get appears to be unintentional.
- Loading branch information