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

AttributeError: 'module' object has no attribute 'core' #4

Open
bra-fsn opened this issue Mar 5, 2013 · 0 comments
Open

AttributeError: 'module' object has no attribute 'core' #4

bra-fsn opened this issue Mar 5, 2013 · 0 comments

Comments

@bra-fsn
Copy link

bra-fsn commented Mar 5, 2013

Hi,

With gevent dev (github master) and pistil, the following example code doesn't start:

import mimetypes
import os


from gevent import monkey
monkey.noisy = False
monkey.patch_all()

from pistil import util
from pistil.tcp.arbiter import TcpArbiter
from pistil.tcp.gevent_worker import TcpGeventWorker

class HttpWorker(TcpGeventWorker):

    def handle(self, sock, addr):
        sock.sendall("hallo\n")


def main():
    conf = {"address": ("127.0.0.1", 5000), "debug": True,
            "num_workers": 3}
    spec = (HttpWorker, 30, "send_file", {}, "worker",)

    arbiter = TcpArbiter(conf, spec)
    arbiter.run()


if __name__ == '__main__':
    main()

It gives the following error:
Traceback (most recent call last):
File "zzz.py", line 11, in
from pistil.tcp.gevent_worker import TcpGeventWorker
File "/usr/local/lib/python2.7/site-packages/pistil-0.2.0-py2.7.egg/pistil/tcp/gevent_worker.py", line 42, in
class TcpGeventWorker(TcpSyncWorker):
File "/usr/local/lib/python2.7/site-packages/pistil-0.2.0-py2.7.egg/pistil/tcp/gevent_worker.py", line 77, in TcpGeventWorker
if hasattr(gevent.core, 'dns_shutdown'):
AttributeError: 'module' object has no attribute 'core'

Adding
import gevent.core
to pistil/tcp/gevent_worker.py fixes this issue.

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

1 participant