progrium/pyjwt — pull request #39 by cjlarose (2014-09-21 06:57:02+00:00)
Title: Allow keys of type "bytes" in Python 3

Recall that in Python 2, `bytes` is just an alias for `str`, and is therefore a `basestring`. In Python 3, `bytes` is not a `basestring`, but still a perfectly acceptable input to `hmac.new`. The function `prepare_HS_key` as defined before, however, always assumed the key was a `basestring`. All tests pass in both Python 2.7 and Python 3.4.