Skip to content

Commit 5ed776f

Browse files
Work around importing the deprecated the imp module in Verify TLS configuration (#3978)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> ## Description <!--- Describe your changes in detail --> ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [ ] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. - [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Landon James <lnj@amazon.com>
1 parent 5e965d9 commit 5ed776f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/ci-tls.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ on:
1919
jobs:
2020
verify-tls-config:
2121
name: Verify TLS configuration
22-
runs-on: ubuntu-latest
22+
# TODO: GH runners recently bumped the default Ubuntu version to 24.x, this comes with an upgraded OpenSSL
23+
# version that causes the python oscrypto package to throw an error: https://github.com/wbond/oscrypto/issues/78
24+
# Until that package is updated we are pinning the version here.
25+
runs-on: ubuntu-22.04
2326
timeout-minutes: 20
2427
steps:
2528
- name: Install packages

tools/ci-scripts/configure-tls/configure-trytls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
set -euxo pipefail
88

99
perl -p -i -e 's!\./runners!runners!' setup.py
10+
11+
sed -i 's/^import imp$/import importlib/' setup.py
12+
sed -i 's/^found = imp.find_module.*/sys.path.insert(0, os.path.join(os.path.dirname(__file__), "runners"))\
13+
found = importlib.util.find_spec("trytls")/' setup.py
14+
sed -i 's/^trytls = imp.load_module(\(.*\))$/trytls = importlib.util.module_from_spec(found)\nfound.loader.exec_module(trytls)/' setup.py
15+
1016
sed -i '/import platform/a import distro' runners/trytls/utils.py
1117
sed -i 's/platform.linux_distribution()/distro.name(), distro.version(), distro.id()/' runners/trytls/utils.py
1218
sed -i 's/break//' runners/trytls/bundles/https.py

0 commit comments

Comments
 (0)