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

Test for "if not PY2" in compatibility code, rather than "if PY3" #10158

Closed
plamut opened this issue Jan 15, 2020 · 0 comments · Fixed by #10081
Closed

Test for "if not PY2" in compatibility code, rather than "if PY3" #10158

plamut opened this issue Jan 15, 2020 · 0 comments · Fixed by #10081
Assignees
Labels
api: logging Issues related to the Cloud Logging API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@plamut
Copy link
Contributor

plamut commented Jan 15, 2020

At a few place the Python 2/3 compatibility code tests if Python 3 is used, assuming the "else" scenario is Python 2. Such tests will break if Python 4 (or some other post-3 version) is ever released.

The fix is to instead split the code paths into "Python 2" and "not Python 2" groups.

@plamut plamut added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: storage Issues related to the Cloud Storage API. api: pubsub Issues related to the Pub/Sub API. api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant