Skip to content

Python 3.10+ type hint syntax incompatible with Python 3.9 (Odoo 16.0) #891

@rossigee

Description

@rossigee

Issue

The file queue_job/controllers/main.py uses Python 3.10+ union operator (|) syntax for type hints, which is incompatible with Python 3.9 that Odoo 16.0 targets.

Location

  • Line 30: def _acquire_job(cls, env: api.Environment, job_uuid: str) -> Job | None:

Details

The union operator (|) for type hints was introduced in PEP 604 for Python 3.10. For Python 3.9 compatibility, this should use the Optional type from the typing module or the older Union syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions