forked from bartvdbraak/blender
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.
This commit is contained in:
parent
d9fa9bffd5
commit
f159ed7746
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user