diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-28 10:00:09 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-28 10:11:10 -0400 |
| commit | 52aad8b80a619b13a67f9306b621df9c0e02bacf (patch) | |
| tree | 9c95134f5be081333babfaa4e9d5c69d4f7b7b7a | |
| parent | 290b70bb2f104c9eac8b672f7a9742d4b94be705 (diff) | |
| download | cmd2-git-52aad8b80a619b13a67f9306b621df9c0e02bacf.tar.gz | |
Added handling for OSError caused by trying to load a GNU readline shared library in
Python environments like PyPy which have a pure Python implementation of readline.
| -rw-r--r-- | cmd2/rl_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py index a8d97fa5..a79f1519 100644 --- a/cmd2/rl_utils.py +++ b/cmd2/rl_utils.py @@ -129,10 +129,10 @@ elif 'gnureadline' in sys.modules or 'readline' in sys.modules: import ctypes readline_lib = ctypes.CDLL(readline.__file__) - except AttributeError: # pragma: no cover + except (AttributeError, OSError): # pragma: no cover _rl_warn_reason = ( "this application is running in a non-standard Python environment in\n" - "which readline is not loaded dynamically from a shared library file." + "which GNU readline is not loaded dynamically from a shared library file." ) else: rl_type = RlType.GNU |
