diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-14 20:40:49 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-14 20:40:49 -0400 |
commit | 0598412960afcbd5fbe42d6cf100b7af658cd959 (patch) | |
tree | db3b490fa05ef029012c02aa11a061b2634f1063 /cmd2 | |
parent | ddd07f9cd6d72baca1232ae98856cf3b3d564706 (diff) | |
download | cmd2-git-0598412960afcbd5fbe42d6cf100b7af658cd959.tar.gz |
Deprecate support for Python 3.4 and begin testing with Python 3.8 beta
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/cmd2.py | 7 | ||||
-rw-r--r-- | cmd2/pyscript_bridge.py | 8 |
2 files changed, 2 insertions, 13 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 02462d96..226e0df7 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -39,6 +39,7 @@ import re import sys import threading from collections import namedtuple +from contextlib import redirect_stdout from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, Union, IO import colorama @@ -103,12 +104,6 @@ except ImportError: return True return NotImplemented -# Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout -if sys.version_info < (3, 5): - # noinspection PyUnresolvedReferences - from contextlib2 import redirect_stdout -else: - from contextlib import redirect_stdout # Detect whether IPython is installed to determine if the built-in "ipy" command should be included ipython_available = True 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 |