diff --git a/sopel_SpiceBot_Runtime_Commands/__init__.py b/sopel_SpiceBot_Runtime_Commands/__init__.py index 78b41f5..ef0a1bb 100644 --- a/sopel_SpiceBot_Runtime_Commands/__init__.py +++ b/sopel_SpiceBot_Runtime_Commands/__init__.py @@ -1,6 +1,4 @@ -from os.path import dirname, basename, isfile, join -import glob -modules = glob.glob(join(dirname(__file__), "*.py")) -__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] -for x in __all__: - import x +#!/usr/bin/env python +import os +import pkgutil +__all__ = list(module for _, module, _ in pkgutil.iter_modules([os.path.dirname(__file__)]))