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

Just delay select.epoll to fix import after gevent monkey patching #2928

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Jan 17, 2024

This seems to work:

Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gevent.monkey
>>> gevent.monkey.patch_all()
True
>>> import trio
>>> exit()

Fixes: #2848

... While trio still doesn't work under gevent, I think not erroring when importing is a good property to have.

@A5rocks A5rocks changed the title Just delay select.epoll to fix import with gevent monkey patching Just delay select.epoll to fix import after gevent monkey patching Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.64%. Comparing base (564907b) to head (b54d224).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2928   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         117      117           
  Lines       17594    17594           
  Branches     3171     3172    +1     
=======================================
  Hits        17532    17532           
  Misses         43       43           
  Partials       19       19           
Files Coverage Δ
src/trio/_core/_io_epoll.py 100.00% <100.00%> (ø)

@A5rocks
Copy link
Contributor Author

A5rocks commented Jan 17, 2024

cc @jeongilpark could you see if this works for you? I'm not sure if you're actually ending up using trio. (if you do, maybe we should do a better solution, like... I don't know, maybe use gevent.monkey.get_original? or... idk this level of trio very well.)

@neevista
Copy link

neevista commented Apr 1, 2024

@jakkdl @CoolCat467 - is this issue and the one specifically listed below resolved now?

gevent/gevent#2008

@jakkdl
Copy link
Member

jakkdl commented Apr 1, 2024

@jakkdl @CoolCat467 - is this issue and the one specifically listed below resolved now?

gevent/gevent#2008

no? I don't see any reason why they've would've been fixed with no changes to any code.

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.

AttributeError: module 'select' has no attribute 'epoll'
4 participants