diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-27 11:04:57 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-27 11:04:57 -0400 |
commit | 1dc7534400724d9c225b3010e915cc6819b0127d (patch) | |
tree | 74a54a0381ad0c6f7a27903d4ab1929a0026bba1 | |
parent | bdd831681d4b9d4202b15157c801a988ccec33df (diff) | |
download | cmd2-git-pypy_fix.tar.gz |
Added handling for OSError caused by trying to load a GNU readline shared library inpypy_fix
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 |