Skip to content

[BUG] Python 3.9 Support #2406

@wannkunstbeikor

Description

@wannkunstbeikor

Describe the bug
Python 3.9 support is broken at the moment because of the pipe operator used here (init.py, init.py
and types.py)

To Reproduce
Just try to run the example on python 3.9

from instagrapi import Client

Traceback

Traceback (most recent call last):
  File "/home/user/test.py", line 3, in <module>
    from instagrapi import Client
  File "/home/user/.local/lib/python3.9/site-packages/instagrapi/__init__.py", line 7, in <module>
    from instagrapi.mixins.account import AccountMixin
  File "/home/user/.local/lib/python3.9/site-packages/instagrapi/mixins/account.py", line 9, in <module>
    from instagrapi.extractors import extract_account, extract_user_short
  File "/home/user/.local/lib/python3.9/site-packages/instagrapi/extractors.py", line 7, in <module>
    from .types import (
  File "/home/user/.local/lib/python3.9/site-packages/instagrapi/types.py", line 425, in <module>
    class Media(TypesBaseModel):
  File "/home/user/.local/lib/python3.9/site-packages/instagrapi/types.py", line 451, in Media
    clips_metadata: Optional[ClipsMetadata | dict] = None
TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'type'

Expected behavior
Not crash or say that python 3.9 is not supported.

Desktop (please complete the following information):

  • OS: Raspbian 11 (bullseye)
  • Python version: 3.9.2
  • instagrapi version: 2.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions