Avoided unneeded assertion on Python 3

Fixes failure introduced in 02e5909f7a.