Skip to content

Commit e01c27e

Browse files
authored
Merge pull request #1176 from wookayin/py312-find-module
Fix PathFinder.find_module AttributeError for Python 3.12
2 parents 57384b9 + afc201a commit e01c27e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pymode/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
import vim # noqa
77

88
if not hasattr(vim, 'find_module'):
9-
vim.find_module = _PathFinder.find_module
9+
try:
10+
vim.find_module = _PathFinder.find_module # deprecated
11+
except AttributeError:
12+
def _find_module(package_name):
13+
spec = _PathFinder.find_spec(package_name)
14+
return spec.loader if spec else None
15+
vim.find_module = _find_module
1016

1117

1218
def auto():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy