hmac only works with `str` type in Python 2

See also http://bugs.python.org/issue5285