Skip to content

Commit 1373a76

Browse files
committed
Replace deprecatd pkgutil with importlib.
1 parent 5a85a1c commit 1373a76

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2015, Ayun Park. All rights reserved.
55
# For licensing, see LICENSE file included in the package.
66
import sys
7-
import pkgutil
7+
import importlib.util
88
from setuptools import setup
99
from setuptools.command.install import install
1010

@@ -13,9 +13,7 @@ class NewInstall(install):
1313

1414
@staticmethod
1515
def check_pymongo():
16-
if pkgutil.find_loader('pymongo'):
17-
return True
18-
return False
16+
return importlib.util.find_spec('pymongo')
1917

2018
def run(self):
2119
install.run(self)

0 commit comments

Comments
 (0)