summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2016-12-11 12:27:45 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2016-12-11 12:27:45 -0500
commit43b1818dd2976d4a2f160fc8ebf2d637c23b7d04 (patch)
treebcb9edc9a22aa1d4458ec1e0ec6411f7cd54bc46
parente9a15b67970fa030d43089c4dc38f22dd89f0ba7 (diff)
downloadcmd2-git-43b1818dd2976d4a2f160fc8ebf2d637c23b7d04.tar.gz
Switched to a safer way of dealing with the fact that Python 3 removed the built-in file() function.
-rwxr-xr-xcmd2.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd2.py b/cmd2.py
index 68304d82..1740f33a 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -42,7 +42,6 @@ from code import InteractiveConsole
from optparse import make_option
import pyparsing
-import six
# next(it) gets next item of iterator it. This is a replacement for calling it.next() in Python 2 and next(it) in Py3
from six import next
@@ -62,11 +61,10 @@ from six.moves.urllib.request import urlopen
# Python 3 compatability hack due to no built-in file keyword in Python 3
# Due to one occurence of isinstance(<foo>, file) checking to see if something is of file type
try:
+ file
+except NameError:
import io
-
file = io.TextIOWrapper
-except ImportError:
- pass # Python2
__version__ = '0.7.0'