Fix Python 3.10 compatibility: Replace datetime.UTC with timezone.utc

- Created datetime_compat module to provide UTC constant using timezone.utc
- Updated all direct UTC imports to use compatibility module
- Added tests to verify UTC timezone compatibility
- Fixes #2171

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-20 01:50:08 +00:00
parent 00c2f5043e
commit c6ed4eaaf6
7 changed files with 37 additions and 10 deletions

View File

@@ -0,0 +1,6 @@
"""Compatibility module for datetime functionality across Python versions."""
from datetime import timezone
# Provide UTC timezone constant that works in Python 3.10+
# This is equivalent to datetime.UTC in Python 3.11+
UTC = timezone.utc