summaryrefslogtreecommitdiff
path: root/cmd2/rl_utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-27 11:04:57 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-27 11:04:57 -0400
commit1dc7534400724d9c225b3010e915cc6819b0127d (patch)
tree74a54a0381ad0c6f7a27903d4ab1929a0026bba1 /cmd2/rl_utils.py
parentbdd831681d4b9d4202b15157c801a988ccec33df (diff)
downloadcmd2-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.
Diffstat (limited to 'cmd2/rl_utils.py')
-rw-r--r--cmd2/rl_utils.py4
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