Skip to content

Commit eaa862d

Browse files
justinmkShougo
andauthored
fix: imp module is deprecated #527
Co-authored-by: Shougo Matsushita <[email protected]>
1 parent ac03f5c commit eaa862d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pynvim/compat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Code for compatibility across Python versions."""
22
import warnings
3-
from imp import find_module as original_find_module
43
from typing import Any, Dict, Optional
54

65

pynvim/plugin/script_host.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# type: ignore
22
"""Legacy python/python3-vim emulation."""
3-
import imp
43
import io
54
import logging
65
import os
@@ -202,6 +201,7 @@ def _get_paths():
202201
return discover_runtime_directories(nvim)
203202

204203
def _find_module(fullname, oldtail, path):
204+
import imp
205205
idx = oldtail.find('.')
206206
if idx > 0:
207207
name = oldtail[:idx]
@@ -222,6 +222,7 @@ def load_module(self, fullname, path=None):
222222
return sys.modules[fullname]
223223
except KeyError:
224224
pass
225+
import imp
225226
return imp.load_module(fullname, *self.module)
226227

227228
class VimPathFinder(object):

0 commit comments

Comments
 (0)