8000 stdout will be set to vim.message, but in early release of vim 7.3, m… · python-mode/python-mode@d2111cd · GitHub
[go: up one dir, main page]

Skip to content

Commit d2111cd

Browse files
author
Wu, Fan
committed
stdout will be set to vim.message, but in early release of vim 7.3, message object didn't have method flush.
It will cause some problems in multiprocessing related code. Fixed of issue #426
1 parent a1423ae commit d2111cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pymode/rope.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import re
77
import site
88
import sys
9+
import StringIO
910

1011
from rope.base import project, libutils, exceptions, change, worder # noqa
1112
from rope.base.fscommands import FileSystemCommands # noqa
@@ -398,9 +399,12 @@ def _update_cache(importer, modules=None):
398399
importer.generate_modules_cache(modules)
399400
importer.project.sync()
400401

402+
sys.stdout, stdout_ = StringIO.StringIO(), sys.stdout
403+
sys.stderr, stderr_ = StringIO.StringIO(), sys.stderr
401404
process = multiprocessing.Process(target=_update_cache, args=(
402405
self.importer, modules))
403406
process.start()
407+
sys.stdout, sys.stderr = stdout_, stderr_
404408

405409

406410
class ProgressHandler(object):

0 commit comments

Comments
 (0)
0