/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

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
 
 
19
17
import io
20
18
 
21
19
from .. import (
22
20
    ui,
23
21
)
24
22
from ..ui import text as ui_text
25
 
from ..sixish import (
26
 
    text_type,
27
 
)
28
23
 
29
24
 
30
25
class StringIOWithEncoding(io.StringIO):
54
49
    def __init__(self, stdin=None, stdout=None, stderr=None):
55
50
        if isinstance(stdin, bytes):
56
51
            stdin = stdin.decode()
57
 
        if isinstance(stdin, text_type):
 
52
        if isinstance(stdin, str):
58
53
            stdin = StringIOWithEncoding(stdin)
59
54
        if stdout is None:
60
55
            stdout = StringIOWithEncoding()