Skip to content

chore(streaming): replace deprecated Version classes from distutils #2752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Changes from all commits
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
7 changes: 5 additions & 2 deletions aws_lambda_powertools/utilities/streaming/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
this file completely. See https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html.
"""
import logging
from distutils.version import StrictVersion
from io import IOBase
from typing import Optional

Expand All @@ -24,7 +23,11 @@

logger = logging.getLogger(__name__)

if StrictVersion(botocore.__version__) < StrictVersion("1.29.13"): # noqa: C901
# Splitting the botocore version string into major, minor, and patch versions,
# and performing a conditional check based on the extracted versions.
major, minor, patch = map(int, botocore.__version__.split("."))

if major == 1 and (minor < 29 or patch < 13):

class PowertoolsStreamingBody(IOBase):
"""Wrapper class for a HTTP response body.
Expand Down