Skip to content
Myr

Add Py2/3 unicode / str compat for documentation tools.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #719

authored by Dan Sully · committed by GitHub · parent 9c456ec · Browse files · 1 file+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−1 removed

  • other:+8 added−1 removed

1 file+8 added−1 removed

modified:docs/clickdoctools.py+8 added-1 removed
15 unmodified lines
1617from sphinx.domains import Domain18from sphinx.util.compat import Directive1920PY2 = sys.version_info[0] == 22122if PY2:23 text_type = unicode24else:25 text_type = str26 2728class EchoingStdin(object):2930 def __init__(self, input, output):31 self._input = input
44 unmodified lines
767778@contextlib.contextmanager79def isolation(input=None, env=None):73 if isinstance(input, unicode):80 if isinstance(input, text_type):81 input = input.encode('utf-8')82 input = StringIO(input or '')83 output = StringIO()84 sys.stdin = EchoingStdin(input, output)
198 unmodified lines