/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/ui_testing.py

  • Committer: Jelmer Vernooij
  • Date: 2020-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
import io
18
20
 
19
21
from .. import (
20
22
    ui,
21
23
)
22
24
from ..ui import text as ui_text
 
25
from ..sixish import (
 
26
    text_type,
 
27
)
23
28
 
24
29
 
25
30
class StringIOWithEncoding(io.StringIO):
49
54
    def __init__(self, stdin=None, stdout=None, stderr=None):
50
55
        if isinstance(stdin, bytes):
51
56
            stdin = stdin.decode()
52
 
        if isinstance(stdin, str):
 
57
        if isinstance(stdin, text_type):
53
58
            stdin = StringIOWithEncoding(stdin)
54
59
        if stdout is None:
55
60
            stdout = StringIOWithEncoding()