Python 2 doesn't care if the input is unicode or bytes. Python 3 only accepts unicode, and will throw an error on bytes. I've added a test to cover the case of passing bytes to this function.