diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-10-09 00:40:14 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-10-09 00:40:14 +0200 |
commit | 8bd734c8e9a6b133a65548672f8a11ee3b3ce677 (patch) | |
tree | 62ba994dc411c3bb693292fa69d5cb2fdb360288 | |
parent | 19aff6d7b6feb28acdb13f2ad5ecdbb3fe44ea88 (diff) | |
download | wee-slack-8bd734c8e9a6b133a65548672f8a11ee3b3ce677.tar.gz |
Fix thread id collision detection not working in Python 2
hashlib returns a byte string in Python 2, but since we only use unicode
strings elsewhere the check against that in
SlackChannelHashedMessages.__missing__ didn't work. Make sure sha1_hex
returns a unicode string instead.
Fixes #800, closes #801
-rw-r--r-- | wee_slack.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 79ce80a..a3d779c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -368,7 +368,7 @@ def get_thread_color(thread_id): def sha1_hex(s): - return hashlib.sha1(s.encode('utf-8')).hexdigest() + return str(hashlib.sha1(s.encode('utf-8')).hexdigest()) def get_functions_with_prefix(prefix): |