[1.5.x] Avoided unneeded assertion on Python 3

Fixes failure introduced in 02e5909f7a.