summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index 8098b996..8b94c3e2 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -49,6 +49,14 @@ try:
except NameError:
raw_input = input
+# Python 3 compatability hack due to no built-in file keyword in Python 3
+# Due to two occurences of isinstance(<foo>, file) checking to see if something is of file type
+try:
+ import io
+ file = io.TextIOWrapper
+except ImportError:
+ pass # Python2
+
if sys.version_info[0] == 2:
pyparsing.ParserElement.enablePackrat()