# HG changeset patch # User Marcin Kuzminski # Date 2012-07-06 00:01:09 # Node ID e8650fbc4d4e33b88239ec02602507ce8eee96d8 # Parent 968c84475f73c2dd34c73b8ef790948edfe3cc43 Moved BytesIO into compat because of py25 compatibility issue diff --git a/rhodecode/lib/compat.py b/rhodecode/lib/compat.py --- a/rhodecode/lib/compat.py +++ b/rhodecode/lib/compat.py @@ -394,3 +394,13 @@ except ImportError: 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 diff --git a/rhodecode/lib/diffs.py b/rhodecode/lib/diffs.py --- a/rhodecode/lib/diffs.py +++ b/rhodecode/lib/diffs.py @@ -26,7 +26,6 @@ # along with this program. If not, see . import re -import io import difflib import markupsafe @@ -39,6 +38,7 @@ from mercurial import localrepo 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 @@ def differ(org_repo, org_ref, other_repo 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: