pycompat: fix bytestr corner case with Python 3.11
This corner case (using pycompat.bytestr
for the bytes
type itself) prevents the expected ProgrammingError
to be properly raised in some changeset lookup scenarios, breaking the tests of heptapod/hgitaly>, and therefore blocking usage of Python 3.11 in Heptapod (a real pain for development setups, production readiness would be farther away).
Targeting the stable branch so that we can have it in the 6.6 series, and it is a minor bug anyway.
Edited by Georges Racinet