Skip to content

FIX: restore Python 3.9 compatibility in tools/#22

Open
lnlscreatives71 wants to merge 1 commit into
digitalsamba:mainfrom
lnlscreatives71:fix/py39-annotations-compat
Open

FIX: restore Python 3.9 compatibility in tools/#22
lnlscreatives71 wants to merge 1 commit into
digitalsamba:mainfrom
lnlscreatives71:fix/py39-annotations-compat

Conversation

@lnlscreatives71
Copy link
Copy Markdown

Summary

16 tools in tools/ use PEP 604 union syntax (X | None) in type annotations. Because these appear on function signatures, they are evaluated at function-definition time and raise TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' on Python 3.9 (PEP 604 unions require 3.10+).

This breaks every cloud GPU tool on import — e.g. file_transfer.py fails to import, which cascades to all R2/Modal/RunPod tooling — despite CLAUDE.md and verify_setup.py both advertising "Python 3.9+" support.

Fix

Add from __future__ import annotations to each affected file, so all annotations are treated as lazy strings and never evaluated at runtime.

Verified there is no non-annotation 3.10+ usage (no match statements, no runtime isinstance(x, A | B) unions), so this fully restores Python 3.9 support with zero behavior change.

Files (16)

addmusic, cloud_gpu, config, dewatermark, file_transfer, flux2, locate_watermark, music, notebooklm_brand, qwen3_tts, redub, sadtalker, sfx, sync_timing, upscale, voiceover

Testing

  • All 16 files byte-compile cleanly on Python 3.9.6
  • Full cloud pipeline verified end-to-end on Python 3.9.6: Qwen3-TTS voiceover generated via Modal (R2 upload → GPU → R2 download)

🤖 Generated with Claude Code

16 tools use `X | None` union syntax in type annotations, which is
evaluated at runtime on function definition and raises TypeError on
Python 3.9 (PEP 604 unions require 3.10+). This broke every cloud GPU
tool on import, despite CLAUDE.md and verify_setup.py advertising
"Python 3.9+" support.

Add `from __future__ import annotations` to each affected file so all
annotations are treated as lazy strings. Verified no non-annotation
3.10+ usage (no match statements, no runtime isinstance unions), so
this fully restores 3.9 support with zero behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants