Skip to content

Commit

Permalink
Merge pull request #25 from ichramm/master
Browse files Browse the repository at this point in the history
Fix exception: TypeError: can't concat bytes to str
  • Loading branch information
netom authored Aug 17, 2018
2 parents 0a8d264 + 4066210 commit 079aa74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyicap.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def set_enc_header(self, header, value):
def set_icap_response(self, code, message=None):
"""Sets the ICAP response's status line and response code"""
self.icap_response = b'ICAP/1.0 ' + str(code).encode('utf-8') + b' ' + \
(message if message else self._responses[code][0])
(str.encode(message) if message else self._responses[code][0])
self.icap_response_code = code

def set_icap_header(self, header, value):
Expand Down

0 comments on commit 079aa74

Please sign in to comment.