Skip to content
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

twisted.internet.cfreactor not importable on Python 3.8 #11965

Closed
graingert opened this issue Sep 8, 2023 · 0 comments · Fixed by #11966
Closed

twisted.internet.cfreactor not importable on Python 3.8 #11965

graingert opened this issue Sep 8, 2023 · 0 comments · Fixed by #11966
Labels

Comments

@graingert
Copy link
Member

Describe the incorrect behavior you saw
fails with:

src/twisted/internet/cfreactor.py:474:24: error: X | Y syntax for unions requires Python 3.10  [syntax]
        _currentSimulator: object | None = None
>>> import twisted.internet.cfreactor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/graingert/projects/twisted/src/twisted/internet/cfreactor.py", line 92, in <module>
    class CFReactor(PosixReactorBase):
  File "/home/graingert/projects/twisted/src/twisted/internet/cfreactor.py", line 474, in CFReactor
    _currentSimulator: object | None = None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Describe how to cause this behavior

import it on Python 3.8

Preferable a Short, Self Contained, Correct (Compilable), Example on a branch or on a gist.

Automated tests that are demonstrating the failure would be awesome.

Describe the correct behavior you'd like to see
no import error

Testing environment
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant