Skip to content

Commit 781da2b

Browse files
committed
Fixes StringIO import error in #pymode#doc#Show. Fixes python-mode#409.
1 parent b79b2e9 commit 781da2b

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)