We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ead0dca commit a5446ceCopy full SHA for a5446ce
pynvim/plugin/script_host.py
@@ -4,6 +4,7 @@
4
import logging
5
import os
6
import sys
7
+from types import ModuleType
8
9
from pynvim.api import Nvim, walk
10
from pynvim.compat import IS_PYTHON3
@@ -37,7 +38,7 @@ def __init__(self, nvim):
37
38
"""Initialize the legacy python-vim environment."""
39
self.setup(nvim)
40
# context where all code will run
- self.module = imp.new_module('__main__')
41
+ self.module = ModuleType('__main__')
42
nvim.script_context = self.module
43
# it seems some plugins assume 'sys' is already imported, so do it now
44
exec('import sys', self.module.__dict__)
0 commit comments