Skip to content

Commit

Permalink
Fix crc32c's __main__ for Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jongy committed Jan 25, 2022
1 parent f0a57a6 commit 356f493
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kafka/record/_crc32c.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ def crc(data):


if __name__ == "__main__":
import six
import sys
# TODO remove the pylint disable once pylint fixes
# https://github.com/PyCQA/pylint/issues/2571
data = sys.stdin.read() # pylint: disable=assignment-from-no-return
if six.PY2:
data = sys.stdin.read() # pylint: disable=assignment-from-no-return
else:
data = sys.stdin.buffer.read() # pylint: disable=assignment-from-no-return
print(hex(crc(data)))

0 comments on commit 356f493

Please sign in to comment.