diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2016-12-11 12:14:00 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2016-12-11 12:14:00 -0500 |
commit | ba9a846ee910e6d8d64a7062e3936f48037a7aaf (patch) | |
tree | 7fdf2419ba0089eff36e6f2b0dc45c8a338c3a3e /cmd2.py | |
parent | 12507cf535bf5fcc4ddfc99df6228c7938090369 (diff) | |
download | cmd2-git-ba9a846ee910e6d8d64a7062e3936f48037a7aaf.tar.gz |
Safer work-around for Python 3 removing the built-in file() function
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -52,10 +52,10 @@ except NameError: # 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 -except ImportError: - pass # Python2 if sys.version_info[0] == 2: pyparsing.ParserElement.enablePackrat() |