Commit 0360fa3
authored
Replace usage of deprecated datetime.utcnow() with datetime.now(UTC) (#360)
* Replace usage of deprecated datetime.utcnow() with datetime.now(UTC)
* fix: reorder imports for consistency in jwt.py and test_jwt.py
* fix: correct usage of datetime.now(UTC) in JWT validation functions
* fix: update datetime usage for compatibility with Python versions
Refactor datetime imports and usage to ensure compatibility with Python 3.12 and 3.13. Replace deprecated datetime.utcnow() with datetime.now(UTC) and handle ImportError for older versions.
* fix: update datetime usage for compatibility with Python 3.12 and 3.13
- Replace deprecated datetime.utcnow() with datetime.now(UTC) for better compatibility.
- Adjusted import statements and usage in jwt.py and test_jwt.py for consistency.1 parent 12f30c8 commit 0360fa3
2 files changed
+35
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
| |||
281 | 290 | | |
282 | 291 | | |
283 | 292 | | |
284 | | - | |
| 293 | + | |
285 | 294 | | |
286 | 295 | | |
287 | 296 | | |
| |||
311 | 320 | | |
312 | 321 | | |
313 | 322 | | |
314 | | - | |
| 323 | + | |
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
| |||
385 | 394 | | |
386 | 395 | | |
387 | 396 | | |
388 | | - | |
| 397 | + | |
389 | 398 | | |
390 | 399 | | |
391 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
180 | 190 | | |
181 | 191 | | |
182 | 192 | | |
183 | | - | |
| 193 | + | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
| |||
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | | - | |
| 222 | + | |
213 | 223 | | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
217 | 227 | | |
218 | 228 | | |
219 | 229 | | |
220 | | - | |
| 230 | + | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| |||
229 | 239 | | |
230 | 240 | | |
231 | 241 | | |
232 | | - | |
| 242 | + | |
233 | 243 | | |
234 | 244 | | |
235 | 245 | | |
| |||
239 | 249 | | |
240 | 250 | | |
241 | 251 | | |
242 | | - | |
| 252 | + | |
243 | 253 | | |
244 | 254 | | |
245 | 255 | | |
| |||
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
264 | | - | |
| 274 | + | |
265 | 275 | | |
266 | 276 | | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
272 | | - | |
| 282 | + | |
273 | 283 | | |
274 | 284 | | |
275 | 285 | | |
| |||
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
284 | | - | |
| 294 | + | |
285 | 295 | | |
286 | 296 | | |
287 | 297 | | |
| |||
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
294 | | - | |
| 304 | + | |
295 | 305 | | |
296 | 306 | | |
297 | 307 | | |
| |||
504 | 514 | | |
505 | 515 | | |
506 | 516 | | |
507 | | - | |
508 | | - | |
| 517 | + | |
| 518 | + | |
509 | 519 | | |
510 | 520 | | |
511 | 521 | | |
| |||
0 commit comments