Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update pkg_resources in mqtt_connection_builder.py
  • Loading branch information
hikeya committed Aug 6, 2025
commit 8a3645e0059168e784f2998e67fa1333ad4c6e0d
6 changes: 3 additions & 3 deletions awsiot/mqtt_connection_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ def _get_metrics_str(current_username=""):

if _metrics_str is None:
try:
import pkg_resources
import importlib.metadata
try:
version = pkg_resources.get_distribution("awsiotsdk").version
version = importlib.metadata.version("awsiotsdk")
_metrics_str = "SDK=PythonV2&Version={}".format(version)
except pkg_resources.DistributionNotFound:
except importlib.metadata.PackageNotFoundError:
_metrics_str = "SDK=PythonV2&Version=dev"
except BaseException:
_metrics_str = ""
Expand Down