diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-14 23:26:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 23:26:54 -0400 |
commit | b3759991adca62779ef7aefbff9dc7004463e129 (patch) | |
tree | 775392576e5c6cd987132c2181b220bb3c09087f /cmd2/pyscript_bridge.py | |
parent | 57ac00c5001dd39dff0fb7800bb8d530c320d7be (diff) | |
parent | 7a30803cd2111e71da644123597cb665885695a8 (diff) | |
download | cmd2-git-b3759991adca62779ef7aefbff9dc7004463e129.tar.gz |
Merge pull request #700 from python-cmd2/deprecate_34
Deprecate Python 3.4 and add support and testing for Python 3.8
Diffstat (limited to 'cmd2/pyscript_bridge.py')
-rw-r--r-- | cmd2/pyscript_bridge.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index e5633173..31c1ab9c 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -5,17 +5,11 @@ degree of isolation between the two """ import sys +from contextlib import redirect_stdout, redirect_stderr from typing import Optional from .utils import namedtuple_with_defaults, StdSim -# Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout -if sys.version_info < (3, 5): - # noinspection PyUnresolvedReferences - from contextlib2 import redirect_stdout, redirect_stderr -else: - from contextlib import redirect_stdout, redirect_stderr - class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr', 'stop', 'data'])): """Encapsulates the results from a cmd2 app command |