Skip to content

Restore python2 compatibility of EC2 plugin #249

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 3 commits into from
Dec 2, 2020
Merged

Conversation

yonash2
Copy link
Contributor

@yonash2 yonash2 commented Nov 24, 2020

Description of changes:
In this PR, python2 compatibility broke.

from urllib.request import urlopen, Request will not work unless install_aliases() is called before:

❯ python2
Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 19 2020, 20:48:48)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import json
>>> import logging
>>> from future.standard_library import install_aliases
>>> from urllib.request import urlopen, Request
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named request
>>> install_aliases()
>>> from urllib.request import urlopen, Request
>>>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Restore python2 compatibility
@yonash2 yonash2 changed the title Update ec2_plugin.py Restore python2 compatibility Nov 24, 2020
@yonash2 yonash2 changed the title Restore python2 compatibility Restore python2 compatibility of EC2 plugin Nov 24, 2020
@codecov-io
Copy link

Codecov Report

Merging #249 (c1d05bf) into master (de3ce93) will decrease coverage by 1.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
- Coverage   79.36%   78.18%   -1.18%     
==========================================
  Files          80       74       -6     
  Lines        3159     2838     -321     
==========================================
- Hits         2507     2219     -288     
+ Misses        652      619      -33     
Impacted Files Coverage Δ
aws_xray_sdk/core/plugins/ec2_plugin.py 95.45% <100.00%> (ø)
aws_xray_sdk/ext/aiobotocore/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
aws_xray_sdk/core/__init__.py 75.00% <0.00%> (-25.00%) ⬇️
aws_xray_sdk/core/utils/compat.py 85.71% <0.00%> (-9.53%) ⬇️
aws_xray_sdk/core/patcher.py 83.20% <0.00%> (-4.00%) ⬇️
aws_xray_sdk/ext/httplib/patch.py 72.63% <0.00%> (-3.16%) ⬇️
aws_xray_sdk/core/sampling/connector.py 47.94% <0.00%> (-2.71%) ⬇️
aws_xray_sdk/core/emitters/udp_emitter.py 61.11% <0.00%> (-2.05%) ⬇️
aws_xray_sdk/ext/util.py 89.83% <0.00%> (-1.70%) ⬇️
aws_xray_sdk/core/sampling/reservoir.py 57.69% <0.00%> (-1.57%) ⬇️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de3ce93...c1d05bf. Read the comment docs.

Copy link
Contributor

@srprash srprash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srprash srprash merged commit 69a8569 into aws:master Dec 2, 2020
Hargrav3s pushed a commit to Gavant/aws-xray-sdk-python that referenced this pull request Mar 22, 2022
Restore python2 compatibility

Co-authored-by: Prashant Srivastava <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants