Skip to content

Commit

Permalink
fix: imp module is deprecated #527
Browse files Browse the repository at this point in the history
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
  • Loading branch information
justinmk and Shougo committed Jul 14, 2023
1 parent ac03f5c commit eaa862d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion pynvim/compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Code for compatibility across Python versions."""
import warnings
from imp import find_module as original_find_module
from typing import Any, Dict, Optional


Expand Down
3 changes: 2 additions & 1 deletion pynvim/plugin/script_host.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# type: ignore
"""Legacy python/python3-vim emulation."""
import imp
import io
import logging
import os
Expand Down Expand Up @@ -202,6 +201,7 @@ def _get_paths():
return discover_runtime_directories(nvim)

def _find_module(fullname, oldtail, path):
import imp
idx = oldtail.find('.')
if idx > 0:
name = oldtail[:idx]
Expand All @@ -222,6 +222,7 @@ def load_module(self, fullname, path=None):
return sys.modules[fullname]
except KeyError:
pass
import imp
return imp.load_module(fullname, *self.module)

class VimPathFinder(object):
Expand Down

0 comments on commit eaa862d

Please sign in to comment.