Skip to content

Commit

Permalink
fix #348 use importlib to replace __import__
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Mar 18, 2024
1 parent 47166c1 commit 0731d0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ffmpeg/common/serialize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import, annotations

import datetime
import importlib
import json
from dataclasses import fields, is_dataclass
from enum import Enum
Expand All @@ -19,7 +20,7 @@ def load_class(path: str) -> Any:
The class.
"""
module_path, class_name = path.rsplit(".", 1)
module = __import__(module_path, fromlist=[class_name])
module = importlib.import_module(module_path)
return getattr(module, class_name)


Expand Down

0 comments on commit 0731d0a

Please sign in to comment.