Merge pull request #2229 from ahlinc/fix_shell_completion

[MRG+1] Fix completion in `scrapy shell` for new imports
This commit is contained in:
Elias Dorneles 2016-09-22 11:15:30 -03:00 committed by GitHub
commit 24bb91528a
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,9 @@ def _embed_ipython_shell(namespace={}, banner=''):
@wraps(_embed_ipython_shell)
def wrapper(namespace=namespace, banner=''):
config = load_default_config()
shell = InteractiveShellEmbed(
# Always use .instace() to ensure _instance propagation to all parents
# this is needed for <TAB> completion works well for new imports
shell = InteractiveShellEmbed.instance(
banner1=banner, user_ns=namespace, config=config)
shell()
return wrapper