Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9863d68

Browse files
committed
Merge pull request python-mode#410 from Cu3PO42/develop
Fixes StringIO import error in #pymode#doc#Show. Fixes python-mode#409.
2 parents b79b2e9 + 781da2b commit 9863d68

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pymode/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ class Options(object):
3131
def get_documentation():
3232
""" Search documentation and append to current buffer. """
3333

34-
import StringIO
34+
try:
35+
from StringIO import StringIO
36+
except ImportError:
37+
from io import StringIO
3538

36-
sys.stdout, _ = StringIO.StringIO(), sys.stdout
39+
sys.stdout, _ = StringIO(), sys.stdout
3740
help(vim.eval('a:word'))
3841
sys.stdout, out = _, sys.stdout.getvalue()
3942
vim.current.buffer.append(str(out).splitlines(), 0)

0 commit comments

Comments
 (0)