Work around missing bin() in Py2.5