diff --git a/pymongo/asynchronous/pool.py b/pymongo/asynchronous/pool.py index 156da7b773..ea5b201747 100644 --- a/pymongo/asynchronous/pool.py +++ b/pymongo/asynchronous/pool.py @@ -194,14 +194,9 @@ def _set_keepalive_times(sock: socket.socket) -> None: _METADATA: dict[str, Any] = {"driver": {"name": "PyMongo", "version": __version__}} if sys.platform.startswith("linux"): - # platform.linux_distribution was deprecated in Python 3.5 - # and removed in Python 3.8. Starting in Python 3.5 it - # raises DeprecationWarning - # DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5 - _name = platform.system() _METADATA["os"] = { - "type": _name, - "name": _name, + "type": platform.system(), + "name": platform.system(), "architecture": platform.machine(), # Kernel version (e.g. 4.4.0-17-generic). "version": platform.release(), diff --git a/pymongo/synchronous/pool.py b/pymongo/synchronous/pool.py index 3918116ba3..adfc82640b 100644 --- a/pymongo/synchronous/pool.py +++ b/pymongo/synchronous/pool.py @@ -194,14 +194,9 @@ def _set_keepalive_times(sock: socket.socket) -> None: _METADATA: dict[str, Any] = {"driver": {"name": "PyMongo", "version": __version__}} if sys.platform.startswith("linux"): - # platform.linux_distribution was deprecated in Python 3.5 - # and removed in Python 3.8. Starting in Python 3.5 it - # raises DeprecationWarning - # DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5 - _name = platform.system() _METADATA["os"] = { - "type": _name, - "name": _name, + "type": platform.system(), + "name": platform.system(), "architecture": platform.machine(), # Kernel version (e.g. 4.4.0-17-generic). "version": platform.release(),