Commit e1c5af7
fix: replace deprecated
This PR replaces the usage of the deprecated
`datetime.datetime.utcfromtimestamp` in the `google-auth-oauthlib`
package and testdata.
Using `datetime.datetime.fromtimestamp(session.token["expires_at"],
datetime.timezone.utc).replace(tzinfo=None)` avoids the deprecation
warning in Python 3.12 while preserving backwards compatibility by
returning a naive datetime object.
Fixes #15433
---
*PR created automatically by Jules for task
[232508796818525143](https://jules.google.com/task/232508796818525143)
started by @chalmerlowe*
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: chalmerlowe <7291104+chalmerlowe@users.noreply.github.com>utcfromtimestamp in google-auth-oauthlib (#16732)1 parent a1417ae commit e1c5af7Copy full SHA for e1c5af7
2 files changed
+6-2Lines changed: 6 additions & 2 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages
- gcp-sphinx-docfx-yaml/tests/testdata/auth/google_auth_oauthlib
- google-auth-oauthlib/google_auth_oauthlib
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/gcp-sphinx-docfx-yaml/tests/testdata/auth/google_auth_oauthlib/helpers.py
Copy file name to clipboardExpand all lines: packages/gcp-sphinx-docfx-yaml/tests/testdata/auth/google_auth_oauthlib/helpers.py+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | | - |
| 150 | + |
| 151 | + |
| 152 | + |
151 | 153 | |
Collapse file
packages/google-auth-oauthlib/google_auth_oauthlib/helpers.py
Copy file name to clipboardExpand all lines: packages/google-auth-oauthlib/google_auth_oauthlib/helpers.py+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | | - |
| 150 | + |
| 151 | + |
| 152 | + |
151 | 153 | |
0 commit comments