OPNA2608 · GitHub

@OPNA2608

Fixes the TestExt test suite on big-endian systems.
`(Ext).code` is implemented by a `long` in the C code, but declared to be backed by an `int` for access from Python. Correct this.
When `long` is larger than `int`, the previous declaration caused only an endian-specific part of the `code` value to get
returned when read from Python-land. On little-endian it was the lower half, and with the valid range of `code` values being
small enough to fit in 1 byte, everything seemed fine.
On big-endian, this returned the upper half of the `long` instead, so all `assert`s of `(Ext).code` values failed because
the only possible values were 0 and -1.

Read the original on github.com ↗