Mercurial > kallithea
changeset 2552:e8650fbc4d4e beta
Moved BytesIO into compat because of py25 compatibility issue
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 06 Jul 2012 00:01:09 +0200 |
parents | 968c84475f73 |
children | 069e13b4dddc |
files | rhodecode/lib/compat.py rhodecode/lib/diffs.py |
diffstat | 2 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/compat.py Thu Jul 05 23:58:08 2012 +0200 +++ b/rhodecode/lib/compat.py Fri Jul 06 00:01:09 2012 +0200 @@ -394,3 +394,13 @@ result = [x + [y] for x in result for y in pool] for prod in result: yield tuple(prod) + + +#============================================================================== +# BytesIO +#============================================================================== + +try: + from io import BytesIO +except ImportError: + from cStringIO import StringIO as BytesIO
--- a/rhodecode/lib/diffs.py Thu Jul 05 23:58:08 2012 +0200 +++ b/rhodecode/lib/diffs.py Fri Jul 06 00:01:09 2012 +0200 @@ -26,7 +26,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import re -import io import difflib import markupsafe @@ -39,6 +38,7 @@ from pylons.i18n.translation import _ +from rhodecode.lib.compat import BytesIO from rhodecode.lib.vcs.exceptions import VCSError from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode from rhodecode.lib.helpers import escape @@ -603,7 +603,7 @@ unbundle = other_repo.getbundle('incoming', common=common, heads=rheads) - buf = io.BytesIO() + buf = BytesIO() while True: chunk = unbundle._stream.read(1024 * 4) if not chunk: