Skip to content

Commit

Permalink
Merge pull request #1 from instantname/dev/pr2
Browse files Browse the repository at this point in the history
Fix for Python 3 compatibility
  • Loading branch information
zachliu authored Apr 19, 2018
2 parents 705d7f4 + 7788b96 commit 23ca679
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gnupg/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ def s(x):
def binary(data):
coder = find_encodings()

if _py3k and isinstance(data, bytes):
encoded = coder.encode(data.decode(coder.name))[0]
elif _py3k and isinstance(data, str):
if _py3k and isinstance(data, str):
encoded = coder.encode(data)[0]
elif not _py3k and type(data) is not str:
encoded = coder.encode(data)[0]
Expand Down

0 comments on commit 23ca679

Please sign in to comment.