diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-26 14:50:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-26 14:54:18 +0300 |
commit | f159ed77466fac81b7487231b5c0ed9314c250d4 (patch) | |
tree | 59895953be492769e4c27c82af125d705ccd8a99 /release | |
parent | d9fa9bffd59185441e88026e5a9f9dbc034383f0 (diff) |
Workaround T43491: Python readline causes crash
loading 'readline' module could crash blender if 'libedit' was already linked (via LLVM).
Workaround the problem for now since we don't even need readline,
a _real_ fix likely involves changing how LLVM or Python are built.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/console_python.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 66956899076..59e4f2314d8 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -226,6 +226,8 @@ execute.hooks = [] def autocomplete(context): + _readline_bypass() + from console import intellisense sc = context.space_data @@ -356,3 +358,14 @@ def banner(context): sc.prompt = PROMPT return {'FINISHED'} + + +# workaround for readline crashing, see: T43491 +def _readline_bypass(): + if "rlcompleter" in sys.modules or "readline" in sys.modules: + return + + # prevent 'rlcompleter' from loading the real 'readline' module. + sys.modules["readline"] = None + import rlcompleter + del sys.modules["readline"] |