Skip to content
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

Fix Python 3 compatibility #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jqueuniet
Copy link

I tried to use this plugin with Python 3 and had to fix a few minor incompatibilities to make it work.

The items() call does return a copy instead of a generator in Python 2, but I think that's a fair compromise as the configuration is very unlikely to be large enough to cause a performance issue.

The dictionary merge could be written as {**dict1, **dict2} from Python 3.5 onward, which probably wouldn't be too much of a stretch as prerequisite as this point, but this would also break Python 2 compatibility.

@jqueuniet
Copy link
Author

I should mention this was tested with Python 3.7.3rc1 and Ansible dev.

@vincentbernat
Copy link

Any change for this to get merged? Python 2 is EOL and we have switched everything to Python 3 on our side. Thanks.

Copy link
Member

@hhenkel hhenkel left a comment

Choose a reason for hiding this comment

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

@crayfishx This PR is identical to what I have locally and therefore I guess it should be merged.

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.

None yet

3 participants