Mercurial > python-hglib
changeset 147:98829bf71f10
util: define BytesIO in one place
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 13 Mar 2015 12:28:06 -0500 |
parents | 8d7bf729a4db |
children | c1b966866ed7 |
files | hglib/client.py tests/test-import.py |
diffstat | 2 files changed, 2 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/hglib/client.py Fri Mar 13 11:34:52 2015 -0400 +++ b/hglib/client.py Fri Mar 13 12:28:06 2015 -0500 @@ -1,11 +1,7 @@ import subprocess, os, struct, re, datetime -try: - from io import BytesIO -except ImportError: - from cStringIO import StringIO as BytesIO import hglib, error, util, templates, merge, context -from util import b, cmdbuilder +from util import b, cmdbuilder, BytesIO class revision(tuple): def __new__(cls, rev, node, tags, branch, author, desc, date):
--- a/tests/test-import.py Fri Mar 13 11:34:52 2015 -0400 +++ b/tests/test-import.py Fri Mar 13 12:28:06 2015 -0500 @@ -1,10 +1,5 @@ import common, os -try: - from io import BytesIO -except ImportError: - from cStringIO import StringIO as BytesIO -import hglib -from hglib.util import b +from hglib.util import b, BytesIO patch = b(""" # HG changeset patch