Python 3 compatibility.

Signed-off-by: Atheriel <atheriel@gmail.com>