Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tiktoken/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def _find_constructors() -> None:
# - it's a separate top-level package because namespace subpackages of non-namespace
# packages don't quite do what you want with editable installs
plugin_mods = pkgutil.iter_modules(tiktoken_ext.__path__, tiktoken_ext.__name__ + ".")

for _, mod_name, _ in plugin_mods:
filtered_plugin_mods = [(loader, mod_name, ispkg) for loader, mod_name, ispkg in plugin_mods if not mod_name.endswith('__pycache__')]

for _, mod_name, _ in filtered_plugin_mods:
mod = importlib.import_module(mod_name)
try:
constructors = mod.ENCODING_CONSTRUCTORS
Expand Down