Skip to content

Commit

Permalink
fix find_module deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
latif committed Nov 15, 2023
1 parent 614d4c2 commit 7f4717a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snscrape/modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pkgutil
import importlib


__all__ = []
Expand All @@ -10,7 +11,7 @@ def _import_modules():
assert not isPkg
moduleNameWithoutPrefix = moduleName[prefixLen:]
__all__.append(moduleNameWithoutPrefix)
module = importer.find_module(moduleName).load_module(moduleName)
module = importlib.import_module(moduleName)
globals()[moduleNameWithoutPrefix] = module


Expand Down

0 comments on commit 7f4717a

Please sign in to comment.