This is an archive of the discontinued Mercurial Phabricator instance.

linelog: be more careful about types before looking for _target attribute
ClosedPublic

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

Details

Summary

Without this, pytype (correctly) complains that fakejge might not have
a _cmprev attribute. We're operating on some constraints not
expressible in the type system, so we detect the invalid case and
raise a nicer exception now.

Sadly, we also need an assert to give PyType a clue that we know
what we're doing, but I can absolutely live with that.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Nov 6 2019, 5:57 PM
indygreg accepted this revision.Nov 7 2019, 3:09 AM
indygreg added a subscriber: indygreg.

I can live with assertions to appease our static analysis bot overlords as well, too.

This revision is now accepted and ready to land.Nov 7 2019, 3:09 AM