Skip to content

fix Python 3.9 and 3.10 compatibility issues#24

Merged
igorbenav merged 3 commits intobenavlabs:mainfrom
msamsami:fix-python39-310-compatibility
Jun 11, 2025
Merged

fix Python 3.9 and 3.10 compatibility issues#24
igorbenav merged 3 commits intobenavlabs:mainfrom
msamsami:fix-python39-310-compatibility

Conversation

@msamsami
Copy link
Copy Markdown
Contributor

@msamsami msamsami commented Jun 10, 2025

This PR fixes compatibility issues for Python 3.9 and 3.10 support:

  • Replace datetime.UTC with timezone.utc (UTC constant only available in Python 3.11+, affects 3.9 and 3.10)
  • Add conditional import for TypeAlias with fallback to typing_extensions for Python 3.9 (TypeAlias only available in Python 3.10+)
  • Replace union syntax X | None with Optional[X] for Python 3.9 compatibility

These changes ensure the package works correctly on Python >= 3.9 as specified in pyproject.toml.

@igorbenav
Copy link
Copy Markdown
Collaborator

Great one, thanks, @msamsami!

@igorbenav igorbenav added the enhancement New feature or request label Jun 11, 2025
@igorbenav igorbenav merged commit 3fc117c into benavlabs:main Jun 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants