AttributeError: 'module' 对象没有属性 'poll'

问题描述

尝试使用 gevent.select.poll 来监视 /sys 下的某些内容。使用本机 Python 时,以下代码工作正常。当我使用 gevent 并执行

from gevent import monkey
monkey.patch_all()

from gevent import select  
p = select.poll()
p.register(fd,select.POLLERR | select.POLLPRI)

while True:
   if p.poll():
      <do something>
           

尝试使用 select.select.poll() 或尝试直接导入 gevent。但是,它不断抛出“AttributeError: 'module' object has no attribute 'poll'”。或者它一直在抛出:

 from gevent.select import poll
 ImportError: cannot import name poll

在这里遗漏了什么吗?从 gevent 代码中,我看到了 poll 类。 https://github.com/gevent/gevent/blob/master/src/gevent/select.py

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)