Skip to content

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

@plamut

Description

@plamut

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.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions