commit | 24ef3e967f4698da6c85778408e920f6437ed344 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Sat Jun 30 17:27:56 2012 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Sat Jun 30 17:27:56 2012 +0200 |
tree | ec35aa2c1aa347abbc4bc4f0ba5ab6e668a8856a | |
parent | 9c7817e9ee0c6d8909a168ba9e12e87d9e7d6caf [diff] [blame] |
Issue #15225: improve error message when hmac is passed a wrong key type. Patch by Marc Abramowitz.
diff --git a/Lib/hmac.py b/Lib/hmac.py index 9c08023..4297a71 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py
@@ -35,7 +35,7 @@ """ 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