Skip to content

Commit

Permalink
Backwards compatibility to importlib_resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Salzmann committed Dec 14, 2023
1 parent 26ff844 commit 72769f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion l4casadi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from importlib.resources import files
try:
from importlib.resources import files
except ImportError:
from importlib_resources import files # type: ignore[no-redef]
import ctypes

from .l4casadi import L4CasADi, dynamic_lib_file_ending
Expand Down
7 changes: 6 additions & 1 deletion l4casadi/l4casadi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
import pathlib
import platform
import shutil
from importlib.resources import files

try:
from importlib.resources import files
except ImportError:
from importlib_resources import files # type: ignore[no-redef]

from typing import Union, Optional, Callable, Text, Tuple

import casadi as cs
Expand Down

0 comments on commit 72769f7

Please sign in to comment.