Skip to content

Commit 75ca516

Browse files
committed
Fix Windows unit tests
1 parent 3a2af4d commit 75ca516

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd2.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import os
3535
import platform
3636
import re
37-
import readline
3837
import shlex
3938
import six
4039
import subprocess
@@ -80,6 +79,13 @@
8079
except ImportError:
8180
ipython_available = False
8281

82+
# Try to import readline, but allow failure for convenience in Windows unit testing
83+
# Note: If this actually fails, you should install readline on Linux or Mac or pyreadline on Windows
84+
try:
85+
import readline
86+
except ImportError:
87+
pass
88+
8389
__version__ = '0.7.1a'
8490

8591
# Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past

0 commit comments

Comments
 (0)