Skip to content

Commit

Permalink
LazyType.load(): Replace __import__() with importlib.import_module()
Browse files Browse the repository at this point in the history
  • Loading branch information
leroyvn committed Jul 28, 2022
1 parent 65ee58d commit 686eacc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[![CalVer](https://img.shields.io/badge/calver-YY.MINOR.MICRO-blue?style=flat-square)](https://calver.org/)

## Dessine-moi 22.1.1 (2022-07-28)

- `LazyType.load()`: Replace `__import__()` with `importlib.import_module()`
({ghpr}`4`).

## Dessine-moi 22.1.0 (2022-07-19)

### Features
Expand Down
3 changes: 2 additions & 1 deletion src/dessinemoi/_core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import importlib
from collections.abc import MutableMapping
from copy import copy
from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, Union
Expand Down Expand Up @@ -104,7 +105,7 @@ def load(self) -> Type:
:return:
Imported type.
"""
mod = __import__(self.mod)
mod = importlib.import_module(self.mod)
return getattr(mod, self.attr)


Expand Down

0 comments on commit 686eacc

Please sign in to comment.