Skip to content

Commit 91c9fd7

Browse files
Anas NaouchiAnas Naouchi
authored andcommitted
Replace derectaed pkg_resources with importlib.metadata to avoid warnings in pythin 3.12+
1 parent 2851e6a commit 91c9fd7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎omise/version.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
import pkg_resources
2-
__VERSION__ = pkg_resources.require('omise')[0].version
1+
from importlib.metadata import version, PackageNotFoundError
2+
try:
3+
__VERSION__ = version("omise")
4+
except PackageNotFoundError:
5+
__VERSION__ = "unknown"

0 commit comments

Comments
 (0)