Commit 7174adab authored by Aurel's avatar Aurel

check we got a string for dump


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@151 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a8c86cd0
......@@ -2,10 +2,13 @@ from zlib import adler32
def dump(s):
"""Dump a binary string in hex."""
ret = []
for c in s:
ret.append('%02x' % ord(c))
return ''.join(ret)
if isinstance(s, str):
ret = []
for c in s:
ret.append('%02x' % ord(c))
return ''.join(ret)
else:
return repr(s)
def makeChecksum(s):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment