Fix error message encoding

- Use the correct unicode string for an error message, otherwise an
exception will generate another exception about incorrect type,
masking the original error.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Simo Sorce 2016-10-05 15:16:30 -04:00 committed by Martin Basti
parent cc5ad6b3f9
commit 2f567f0e8e

View File

@ -603,7 +603,8 @@ class KerbTransport(SSLTransport):
except (TypeError, UnicodeError): except (TypeError, UnicodeError):
pass pass
if not token: if not token:
raise KerberosError(message="No valid Negotiate header in server response") raise KerberosError(
message=u"No valid Negotiate header in server response")
token = self._sec_context.step(token=token) token = self._sec_context.step(token=token)
if self._sec_context.complete: if self._sec_context.complete:
self._sec_context = None self._sec_context = None