Skip to content

[nodriver] python 3.9 imcompatibility: TypeError: unsupported operand type(s) for |: 'type' and 'type' #2172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dannyp11 opened this issue Apr 5, 2025 · 2 comments

Comments

@dannyp11
Copy link

dannyp11 commented Apr 5, 2025

Looks like typing operand | is only supported in python>=3.10

  File "/usr/local/danny-config/python3/lib/python3.9/site-packages/nodriver/__init__.py", line 2, in <module>
    from nodriver.core import util
  File "/usr/local/danny-config/python3/lib/python3.9/site-packages/nodriver/core/util.py", line 21, in <module>
    from .element import Element
  File "/usr/local/danny-config/python3/lib/python3.9/site-packages/nodriver/core/element.py", line 13, in <module>
    from .config import PathLike
  File "/usr/local/danny-config/python3/lib/python3.9/site-packages/nodriver/core/config.py", line 25, in <module>
    PathLike = TypeVar("PathLike", bound=str | pathlib.Path)
TypeError: unsupported operand type(s) for |: 'type' and 'type'
@dannyp11
Copy link
Author

dannyp11 commented Apr 5, 2025

well I went ahead and tried this fix, works for me

Here's for those getting the same issue
https://github.com/ultrafunkamsterdam/nodriver/compare/main...dannyp11:nodriver:fix-3.9-compat?expand=1

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

No branches or pull requests

2 participants
@dannyp11 and others