summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rwxr-xr-xcmd2.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..24c540b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+__pycache__
+build
+dist
+cmd2.egg-info
+.idea
+.cache
+
diff --git a/cmd2.py b/cmd2.py
index 8098b996..237d1bfd 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:
+ file
+except NameError:
+ import io
+ file = io.TextIOWrapper
+
if sys.version_info[0] == 2:
pyparsing.ParserElement.enablePackrat()