We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 079fe3d commit 8ab0d0dCopy full SHA for 8ab0d0d
2 files changed
.gitignore
@@ -133,3 +133,4 @@ server/tinytuya
133
134
# Local issue response archive
135
issues/
136
+server/.beta_build
setup.py
@@ -1,5 +1,11 @@
1
import setuptools
2
-from pkg_resources import DistributionNotFound, get_distribution
+try:
3
+ from importlib.metadata import version as _pkg_version, PackageNotFoundError as DistributionNotFound
4
+ def get_distribution(name):
5
+ _pkg_version(name) # raises DistributionNotFound if not installed
6
+ return name
7
+except ImportError:
8
+ from pkg_resources import DistributionNotFound, get_distribution
9
10
from tinytuya import __version__
11
0 commit comments