diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2016-12-11 23:41:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-11 23:41:45 +0100 |
commit | ef074cc2ffb64b2c5281757820f6904bd368d51e (patch) | |
tree | 7fdf2419ba0089eff36e6f2b0dc45c8a338c3a3e /cmd2.py | |
parent | c6e1f1e58ce65686329e2163c0da17d84a446f2d (diff) | |
parent | ba9a846ee910e6d8d64a7062e3936f48037a7aaf (diff) | |
download | cmd2-git-ef074cc2ffb64b2c5281757820f6904bd368d51e.tar.gz |
Merge pull request #28 from tleonhardt/master
Loading in a script file now works in Python 3.5
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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() |