Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 36725:f659a407e5ee
py3: use util.forcebytestr instead of str to convert error messages
Differential Revision: https://phab.mercurial-scm.org/D2649
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 04 Mar 2018 22:37:41 +0530 |
parents | f574cc00831a |
children | 981f328d6d16 |
comparison
equal
deleted
inserted
replaced
36724:d77c3b023393 | 36725:f659a407e5ee |
---|---|
1994 | 1994 |
1995 if t == 'x': | 1995 if t == 'x': |
1996 try: | 1996 try: |
1997 return _zlibdecompress(data) | 1997 return _zlibdecompress(data) |
1998 except zlib.error as e: | 1998 except zlib.error as e: |
1999 raise RevlogError(_('revlog decompress error: %s') % str(e)) | 1999 raise RevlogError(_('revlog decompress error: %s') % |
2000 util.forcebytestr(e)) | |
2000 # '\0' is more common than 'u' so it goes first. | 2001 # '\0' is more common than 'u' so it goes first. |
2001 elif t == '\0': | 2002 elif t == '\0': |
2002 return data | 2003 return data |
2003 elif t == 'u': | 2004 elif t == 'u': |
2004 return util.buffer(data, 1) | 2005 return util.buffer(data, 1) |