diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-02 02:54:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-02 02:54:39 +0400 |
commit | 2e7c8bbeec1592212c315172a427f2c5dab70de7 (patch) | |
tree | b8de4a07d1208ce05d66baa142981fc0e6d6f04b /release | |
parent | c92e3225f3aa5fadb9ad0920dffbdc0c0209a98a (diff) |
fix for py console autocomp. need to swap out __main__ module there too.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/console_python.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index 2881e87fe00..70b24ddf2fa 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -205,6 +205,10 @@ def autocomplete(context): scrollback = "" scrollback_error = "" + if _BPY_MAIN_OWN: + main_mod_back = sys.modules["__main__"] + sys.modules["__main__"] = console._bpy_main_mod + try: current_line = sc.history[-1] line = current_line.line @@ -223,6 +227,9 @@ def autocomplete(context): import traceback scrollback_error = traceback.format_exc() + if _BPY_MAIN_OWN: + sys.modules["__main__"] = main_mod_back + # Separate automplete output by command prompts if scrollback != '': bpy.ops.console.scrollback_append(text=sc.prompt + current_line.line, type='INPUT') |