Skip to content

Commit

Permalink
ENH: fix deprecation warning by pkgutil.find_loader (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
hucorz authored Nov 4, 2024
1 parent 2e0d3f1 commit 2945d9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/xoscar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import dataclasses
import functools
import importlib
import importlib.util as importlib_utils
import inspect
import io
import logging
import os
import pkgutil
import random
import socket
import sys
Expand Down Expand Up @@ -267,7 +267,7 @@ def add_load_handler(self, func: Callable):
self._on_loads.append(func)
return func

if pkgutil.find_loader(prefix_name) is not None:
if importlib_utils.find_spec(prefix_name) is not None:
return LazyModule()
elif placeholder:
return ModulePlaceholder(prefix_name)
Expand Down

0 comments on commit 2945d9a

Please sign in to comment.