From 24ef3e967f4698da6c85778408e920f6437ed344 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 30 Jun 2012 17:27:56 +0200 Subject: Issue #15225: improve error message when hmac is passed a wrong key type. Patch by Marc Abramowitz. --- Lib/hmac.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/hmac.py') diff --git a/Lib/hmac.py b/Lib/hmac.py index 9c080233da8..4297a7171ab 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -35,7 +35,7 @@ class HMAC: """ if not isinstance(key, bytes): - raise TypeError("expected bytes, but got %r" % type(key).__name__) + raise TypeError("key: expected bytes, but got %r" % type(key).__name__) if digestmod is None: import hashlib -- cgit v1.2.3