Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Fix a Python 2 compatibility issue #204

Merged

Conversation

palnabarun
Copy link
Member

@palnabarun palnabarun commented Jul 16, 2020

PR #133 introduces the usage of `http` module for checking the status
code for `GONE` HTTP status. However, this doesn't work in Python 2.7.

This commit checks if the interpreter is Python 2 and imports the
status code from `httplib` module instead and unifies the approach
to the checks.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 16, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 16, 2020
PR kubernetes-client#133 introduces the usage of `http` module for checking the status
code for `GONE` HTTP status. However, this doesn't work in Python 2.7.

This commit checks if the interpreter is Python 2 and imports the
status code from `httplib` module instead and unifies the approach
to the checks.

Signed-off-by: Nabarun Pal <[email protected]>
@palnabarun
Copy link
Member Author

/assign @roycaihw @yliaog

Signed-off-by: Nabarun Pal <[email protected]>
@yliaog
Copy link
Contributor

yliaog commented Jul 16, 2020

thanks for the fix

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: palnabarun, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit fb86b8a into kubernetes-client:master Jul 16, 2020
@palnabarun palnabarun deleted the fix-watch-py2-compatibility branch July 16, 2020 22:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants