Skip to content

Commit d9dba96

Browse files
chore(streaming): replace deprecated Version classes from distutils (#2752)
1 parent e2372f1 commit d9dba96

File tree

1 file changed

+5
-2
lines changed
  • aws_lambda_powertools/utilities/streaming

1 file changed

+5
-2
lines changed

aws_lambda_powertools/utilities/streaming/compat.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
this file completely. See https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html.
88
"""
99
import logging
10-
from distutils.version import StrictVersion
1110
from io import IOBase
1211
from typing import Optional
1312

@@ -24,7 +23,11 @@
2423

2524
logger = logging.getLogger(__name__)
2625

27-
if StrictVersion(botocore.__version__) < StrictVersion("1.29.13"): # noqa: C901
26+
# Splitting the botocore version string into major, minor, and patch versions,
27+
# and performing a conditional check based on the extracted versions.
28+
major, minor, patch = map(int, botocore.__version__.split("."))
29+
30+
if major == 1 and (minor < 29 or patch < 13):
2831

2932
class PowertoolsStreamingBody(IOBase):
3033
"""Wrapper class for a HTTP response body.

0 commit comments

Comments
 (0)