Skip to content

Conversation

@rwhogg
Copy link
Contributor

@rwhogg rwhogg commented Dec 15, 2022

Mostly get rid of older Py2-only code

@rwhogg rwhogg requested review from a team as code owners December 15, 2022 15:26
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-ndb API. label Dec 15, 2022
def context(self):
return self._context.get()

except ImportError: # pragma: NO PY3 COVER
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: it's easier to see that this change is correct if you view it with split-diffs and while ignoring whitespace changes

try:
a.frombytes(s)
except AttributeError: # pragma: NO PY3 COVER
a.fromstring(s)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fromstring is a deprecated alias for frombytes. Ditto for tostring vs. tobytes.

The string versions date from Py2 and were renamed and aliased in Py3 due to the bytes/string distinction. The aliases were removed in Python 3.9.

Mostly get rid of older Py2-only code
@rwhogg rwhogg changed the title DO NOT MERGE chore: Restore code coverage chore: Restore code coverage Dec 15, 2022
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 15, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 15, 2022
@parthea parthea enabled auto-merge (squash) December 15, 2022 17:08
@parthea parthea merged commit 15fcea2 into googleapis:main Dec 15, 2022
@rwhogg rwhogg deleted the restore-coverage branch December 15, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the googleapis/python-ndb API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants