| 1 | Patch-Source: https://github.com/py-bson/bson/commit/4e6b4c206f7204034ef74bff8ae84a95d76d1684
|
| 2 | ---
|
| 3 | From 4e6b4c206f7204034ef74bff8ae84a95d76d1684 Mon Sep 17 00:00:00 2001
|
| 4 | From: Evgeny Chernyavskiy <[email protected]>
|
| 5 | Date: Thu, 27 Nov 2025 17:19:29 +0700
|
| 6 | Subject: [PATCH] Replace deprecated `pkgutil` with `importlib`. Add Python
|
| 7 | 3.14 to the test matrix. (#140)
|
| 8 |
|
| 9 | ---
|
| 10 | .github/workflows/main.yml | 2 +-
|
| 11 | setup.py | 18 ++++++++----------
|
| 12 | 2 files changed, 9 insertions(+), 11 deletions(-)
|
| 13 |
|
| 14 | diff --git a/setup.py b/setup.py
|
| 15 | index 74d5002..0921062 100755
|
| 16 | |
| 17 | |
| 18 | @@ -4,7 +4,7 @@
|
| 19 | # Copyright (c) 2015, Ayun Park. All rights reserved.
|
| 20 | # For licensing, see LICENSE file included in the package.
|
| 21 | import sys
|
| 22 | -import pkgutil
|
| 23 | +import importlib.util
|
| 24 | from setuptools import setup
|
| 25 | from setuptools.command.install import install
|
| 26 |
|
| 27 | @@ -13,9 +13,7 @@ class NewInstall(install):
|
| 28 |
|
| 29 | @staticmethod
|
| 30 | def check_pymongo():
|
| 31 | - if pkgutil.find_loader('pymongo'):
|
| 32 | - return True
|
| 33 | - return False
|
| 34 | + return importlib.util.find_spec('pymongo')
|
| 35 |
|
| 36 | def run(self):
|
| 37 | install.run(self)
|