Patch-Source: https://github.com/py-bson/bson/commit/4e6b4c206f7204034ef74bff8ae84a95d76d1684 --- From 4e6b4c206f7204034ef74bff8ae84a95d76d1684 Mon Sep 17 00:00:00 2001 From: Evgeny Chernyavskiy Date: Thu, 27 Nov 2025 17:19:29 +0700 Subject: [PATCH] Replace deprecated `pkgutil` with `importlib`. Add Python 3.14 to the test matrix. (#140) --- .github/workflows/main.yml | 2 +- setup.py | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 74d5002..0921062 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ # Copyright (c) 2015, Ayun Park. All rights reserved. # For licensing, see LICENSE file included in the package. import sys -import pkgutil +import importlib.util from setuptools import setup from setuptools.command.install import install @@ -13,9 +13,7 @@ class NewInstall(install): @staticmethod def check_pymongo(): - if pkgutil.find_loader('pymongo'): - return True - return False + return importlib.util.find_spec('pymongo') def run(self): install.run(self)